[code_opt_3.3.0] fix ui

This commit is contained in:
zhongchao
2023-06-07 17:50:48 +08:00
parent 65abe76e7d
commit 94d41eb26b
24 changed files with 116 additions and 125 deletions

View File

@@ -10,29 +10,29 @@ import com.mogo.cloud.passport.MoGoAiCloudClientConfig
import com.mogo.eagle.core.data.autopilot.AutopilotControlParameters
import com.mogo.eagle.core.data.autopilot.toAutoPilotLine
import com.mogo.eagle.core.data.autopilot.toRouteInfo
import com.mogo.eagle.core.data.deva.badcase.BagManagerEntity
import com.mogo.eagle.core.data.biz.trafficlight.TrafficLightResult
import com.mogo.eagle.core.data.biz.trafficlight.toTrafficLightDetail
import com.mogo.eagle.core.data.config.FunctionBuildConfig
import com.mogo.eagle.core.data.constants.MoGoConfig
import com.mogo.eagle.core.data.constants.MogoServicePaths
import com.mogo.eagle.core.data.deva.badcase.BagManagerEntity
import com.mogo.eagle.core.data.deva.chain.ChainConstant
import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_CODE_MULTI_CONNECT
import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_SOURCE_ADAS
import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_TYPE_INIT_STATUS
import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_TYPE_SOCKET_AUTOPILOT
import com.mogo.eagle.core.data.biz.trafficlight.TrafficLightResult
import com.mogo.eagle.core.data.biz.trafficlight.toTrafficLightDetail
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotCarConfigListener
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotControlProvider
import com.mogo.eagle.core.function.api.map.collect.IMoGoMapDataCollectProvider
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotCarConfigListenerManager
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager
import com.mogo.eagle.core.function.call.map.CallerMapDataCollectorManager
import com.mogo.eagle.core.function.datacenter.autopilot.adapter.MoGoAdasListenerImpl
import com.mogo.eagle.core.function.datacenter.autopilot.adapter.MoGoAdasMsgConnectStatusListenerImpl
import com.mogo.eagle.core.function.datacenter.autopilot.server.AsyncDataToAutopilotServer
import com.mogo.eagle.core.function.datacenter.autopilot.telematic.EventListener
import com.mogo.eagle.core.function.datacenter.autopilot.telematic.IMsgHandler
import com.mogo.eagle.core.function.datacenter.autopilot.telematic.TeleMsgHandler
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotCarConfigListenerManager
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager
import com.mogo.eagle.core.function.call.map.CallerMapDataCollectorManager
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_ADAS_IMPL
@@ -332,8 +332,10 @@ class MoGoAutopilotControlProvider :
@ChainLog(
linkChainLog = CHAIN_TYPE_SOCKET_AUTOPILOT,
linkCode = CHAIN_SOURCE_ADAS,
parentNodeAliasCode = ChainConstant.CHAIN_CODE_EAGLE_START_AUTOPILOT,
nodeAliasCode = ChainConstant.CHAIN_CODE_EAGLE_START_AUTOPILOT_RESULT,
paramIndexes = [0]
)
private fun invokeAutoPilotResult(status: String) {
CallerLogger.e("$M_ADAS_IMPL$TAG", status)
@@ -518,9 +520,9 @@ class MoGoAutopilotControlProvider :
* @return boolean
*/
override fun sendDetouring(isEnable: Boolean): Boolean {
return if(isEnable){
return if (isEnable) {
AdasManager.getInstance().sendDetouring(1)
}else{
} else {
AdasManager.getInstance().sendDetouring(0)
}
}
@@ -541,9 +543,9 @@ class MoGoAutopilotControlProvider :
* @return boolean
*/
override fun sendWeakNetSlowDown(isEnable: Boolean): Boolean {
return if(isEnable){
return if (isEnable) {
AdasManager.getInstance().sendWeakNetSlowDown(1)
}else{
} else {
AdasManager.getInstance().sendWeakNetSlowDown(0)
}
}
@@ -555,7 +557,7 @@ class MoGoAutopilotControlProvider :
* @return boolean
*/
override fun sendGetAllParamReq(): Boolean {
return AdasManager.getInstance().sendGetAllParamReq()
return AdasManager.getInstance().sendGetAllParamReq()
}
/**
@@ -576,8 +578,13 @@ class MoGoAutopilotControlProvider :
* @param topicsNeedToCache
* @return boolean
*/
override fun getBadCaseConfig(reqType: Int,recordType: Int,topicsNeedToCache: List<String>): Boolean{
return AdasManager.getInstance().sendRecordDataConfigReq(reqType, recordType, topicsNeedToCache)
override fun getBadCaseConfig(
reqType: Int,
recordType: Int,
topicsNeedToCache: List<String>
): Boolean {
return AdasManager.getInstance()
.sendRecordDataConfigReq(reqType, recordType, topicsNeedToCache)
}
/**
@@ -605,7 +612,7 @@ class MoGoAutopilotControlProvider :
bagManager.descReq = descReq.build()
// 空间使用信息,获取响应且reqType=1时有效
for(diskSpaceInfoEntity in bagManagerEntity.spaceInfoResp){
for (diskSpaceInfoEntity in bagManagerEntity.spaceInfoResp) {
val spaceInfoResp = BagManagerOuterClass.BagSpaceInfo
.newBuilder()
val diskSpaceInfo = BagManagerOuterClass.SpaceInfo
@@ -617,7 +624,7 @@ class MoGoAutopilotControlProvider :
.build()
spaceInfoResp
.setHost(diskSpaceInfoEntity.host).diskSpaceInfo = diskSpaceInfo
for(entity in diskSpaceInfoEntity.BagDirsSpaceInfo){
for (entity in diskSpaceInfoEntity.BagDirsSpaceInfo) {
val bagDirsSpaceInfo = BagManagerOuterClass.SpaceInfo
.newBuilder()
.setDirectory(entity.directory)
@@ -631,8 +638,8 @@ class MoGoAutopilotControlProvider :
}
// 包信息列表,获取响应且reqType=2时有效
for(bagsInfoRespEntity in bagManagerEntity.bagsInfoResp){
if(bagsInfoRespEntity.itemType == 0){
for (bagsInfoRespEntity in bagManagerEntity.bagsInfoResp) {
if (bagsInfoRespEntity.itemType == 0) {
// 包描述信息
val bagDescription = BagManagerOuterClass.BagDescription
.newBuilder()
@@ -654,7 +661,7 @@ class MoGoAutopilotControlProvider :
.setDescription(bagDescription.build())
// 子包信息
for(subBagEntity in bagsInfoRespEntity.subBags){
for (subBagEntity in bagsInfoRespEntity.subBags) {
val subBag = BagManagerOuterClass.SubBag
.newBuilder()
.setKey(subBagEntity.key)
@@ -731,8 +738,15 @@ class MoGoAutopilotControlProvider :
* @param isLastStop 是否最终站
* @return boolean
*/
override fun sendTripInfo(type: Int, lineName: String, departureStopName: String,arrivalStopName: String, isLastStop: Boolean) {
AdasManager.getInstance().sendTripInfoReq(type, lineName, departureStopName,arrivalStopName, isLastStop)
override fun sendTripInfo(
type: Int,
lineName: String,
departureStopName: String,
arrivalStopName: String,
isLastStop: Boolean
) {
AdasManager.getInstance()
.sendTripInfoReq(type, lineName, departureStopName, arrivalStopName, isLastStop)
}
/**
@@ -840,15 +854,18 @@ class MoGoAutopilotControlProvider :
}
msgHandler.synMsgToAllClients()
} else {// 乘客屏
CallerDevaToolsManager.getBindingCarInfo( carConfigResp.macAddress, MoGoAiCloudClientConfig.getInstance().sn)
CallerDevaToolsManager.getBindingCarInfo(
carConfigResp.macAddress,
MoGoAiCloudClientConfig.getInstance().sn
)
invokeNettyConnResult("乘客屏车牌号:${carConfigResp.plateNumber},Mac地址为${carConfigResp.macAddress}")
}
if(carConfigResp.dockVersion.isNotEmpty()){
if(carConfigResp.dockVersion.contains("taxi")){
if (carConfigResp.dockVersion.isNotEmpty()) {
if (carConfigResp.dockVersion.contains("taxi")) {
//修改雨天模式开关默认状态为开启仅针对taxi320及以上的版本-sop 215
val num = ParseVersionUtils.parseVersion(true,carConfigResp.dockVersion)
if(num >= 30200){
val num = ParseVersionUtils.parseVersion(true, carConfigResp.dockVersion)
if (num >= 30200) {
FunctionBuildConfig.isRainMode = true
}
}
@@ -884,12 +901,14 @@ class MoGoAutopilotControlProvider :
AdasManager.getInstance().subscribeInterface(
Constants.TERMINAL_ROLE.DRIVER,
Constants.SUBSCRIBE_TYPE.SUBSCRIBE,
MessageType.TYPE_RECEIVE_POINT_CLOUD)
MessageType.TYPE_RECEIVE_POINT_CLOUD
)
} else {
AdasManager.getInstance().subscribeInterface(
Constants.TERMINAL_ROLE.DRIVER,
Constants.SUBSCRIBE_TYPE.UNSUBSCRIBE,
MessageType.TYPE_RECEIVE_POINT_CLOUD)
MessageType.TYPE_RECEIVE_POINT_CLOUD
)
}
}
@@ -903,7 +922,8 @@ class MoGoAutopilotControlProvider :
windSpeedCmd: Int,
temperatureCmd: Int
): Boolean {
return AdasManager.getInstance().sendRoboBusJinlvM1AirConditionerCmd(switchCmd, modeCmd, windSpeedCmd, temperatureCmd)
return AdasManager.getInstance()
.sendRoboBusJinlvM1AirConditionerCmd(switchCmd, modeCmd, windSpeedCmd, temperatureCmd)
}
override fun sendRoboBusJinlvM1HeaderCmd(switchCmd: Int, windSpeedCmd: Int): Boolean {

View File

@@ -1,5 +1,6 @@
package com.mogo.eagle.core.function.datacenter.location
import android.util.Log
import com.mogo.eagle.core.data.config.FunctionBuildConfig
import com.mogo.eagle.core.data.enums.DataSourceType
import com.mogo.eagle.core.data.map.MogoLocation
@@ -52,6 +53,7 @@ object MoGoLocationDispatcher :
override fun onChassisGnss(gnssInfo: MessagePad.GnssInfo) {
// 更新GNSS 信息
Log.d("emArrow","高精 heading:${gnssInfo.heading}")
lastGnssLocation.gnssInfo = gnssInfo
lastGnssLocation.lastReceiveTime = TimeUtils.getNowMills()
// 将高德中的一些用于业务的数据进行融合例如CityCode、address等
@@ -102,7 +104,7 @@ object MoGoLocationDispatcher :
override fun onMoGoLocationChanged(mogoLocation: MogoLocation) {
// 更新GaoDe 信息
lastGaoDeLocation = mogoLocation
Log.d("emArrow","高德 heading:${mogoLocation.heading}")
// 计算最后一次工控机同步的定位是否超时,如果超时则切换为高德地图定位,暂定超过30秒需要切换
if (1 == FunctionBuildConfig.gpsProvider) {
if (TimeUtils.getNowMills() - lastGnssLocation.lastReceiveTime > 10000) {