add log
This commit is contained in:
@@ -5,17 +5,21 @@ import android.content.Context
|
||||
import androidx.annotation.RequiresPermission
|
||||
import com.alibaba.android.arouter.facade.annotation.Route
|
||||
import com.mogo.cloud.passport.MoGoAiCloudClientConfig
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotControlCmdParameter
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotControlParameters
|
||||
import com.mogo.eagle.core.data.autopilot.toRouteInfo
|
||||
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.scene.SceneConstant.Companion.M_ADAS_IMPL
|
||||
import com.mogo.eagle.core.data.trafficlight.TrafficLightResult
|
||||
import com.mogo.eagle.core.data.trafficlight.toTrafficLightDetail
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotProvider
|
||||
import com.mogo.eagle.core.function.api.map.collect.IMoGoMapDataCollectProvider
|
||||
import com.mogo.eagle.core.function.autopilot.adapter.MoGoAdasListenerImpl
|
||||
import com.mogo.eagle.core.function.autopilot.adapter.MoGoAdasMsgConnectStatusListenerImpl
|
||||
import com.mogo.eagle.core.function.autopilot.adapter.MoGoHandAdasMsgManager
|
||||
import com.mogo.eagle.core.function.autopilot.server.AsyncDataToAutopilotServer
|
||||
import com.mogo.eagle.core.function.call.logger.CallerLogger
|
||||
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.Logger
|
||||
@@ -52,8 +56,8 @@ class MoGoAutopilotProvider :
|
||||
get() = TAG
|
||||
|
||||
override fun init(context: Context) {
|
||||
MoGoHandAdasMsgManager.getInstance();
|
||||
Logger.d(TAG, "初始化工控机连接……")
|
||||
MoGoHandAdasMsgManager.getInstance()
|
||||
CallerLogger.i("$M_ADAS_IMPL$TAG", "初始化工控机连接……")
|
||||
mContext = context
|
||||
// 初始化ADAS 域控制器
|
||||
CupidLogUtils.setEnableLog(false)
|
||||
@@ -72,26 +76,24 @@ class MoGoAutopilotProvider :
|
||||
NSDNettyManager.getInstance().startNSDNettyServerWithSN(context, object :
|
||||
NettyServerListener<MogoProtocolMsg> {
|
||||
override fun onMessageResponseServer(msg: MogoProtocolMsg?, channel: Channel?) {
|
||||
Logger.d(TAG, "Receive client data is:${msg?.toString()}")
|
||||
CallerLogger.d("$M_ADAS_IMPL$TAG", "Receive client data is:${msg?.toString()}")
|
||||
}
|
||||
|
||||
override fun onStartServer() {
|
||||
ToastUtils.showShort("司机端服务启动成功!")
|
||||
Logger.d(TAG, "onStartServer")
|
||||
}
|
||||
|
||||
override fun onStopServer() {
|
||||
ToastUtils.showLong("司机端服务停止!")
|
||||
Logger.d(TAG, "onStopServer")
|
||||
}
|
||||
|
||||
override fun onChannelConnect(channel: Channel?) {
|
||||
val socketAddress = channel?.remoteAddress().toString()
|
||||
Logger.d(TAG, "Client ip is:${socketAddress}")
|
||||
CallerLogger.d("$M_ADAS_IMPL$TAG", "Client ip is:${socketAddress}")
|
||||
}
|
||||
|
||||
override fun onChannelDisConnect(channel: Channel?) {
|
||||
Logger.d(TAG, "onChannelDisConnect")
|
||||
CallerLogger.d("$M_ADAS_IMPL$TAG", "onChannelDisConnect")
|
||||
}
|
||||
}, MoGoAiCloudClientConfig.getInstance().sn)
|
||||
} else {
|
||||
@@ -108,22 +110,23 @@ class MoGoAutopilotProvider :
|
||||
.searchAndConnectServer(context, MoGoAiCloudClientConfig.getInstance().sn, object :
|
||||
NettyClientListener<MogoProtocolMsg> {
|
||||
override fun onMessageResponseClient(msg: MogoProtocolMsg?, sign: String?) {
|
||||
Logger.d(TAG, "收到司机端的数据!")
|
||||
// 乘客端收到adas数据直接解析,后续分发解析后的数据流程同司机端
|
||||
msg?.let {
|
||||
AdasManager.getInstance().parseIPCData(it.body)
|
||||
Logger.d(TAG, "解析司机端数据完毕!")
|
||||
}
|
||||
}
|
||||
|
||||
override fun onClientStatusConnectChanged(statusCode: Int, sign: String?) {
|
||||
when (statusCode) {
|
||||
ConnectState.STATUS_CONNECT_SUCCESS -> {
|
||||
Logger.d(TAG, "乘客端连接司机端服务成功! sign is:${sign}")
|
||||
CallerLogger.d("$M_ADAS_IMPL$TAG", "乘客端连接司机端服务成功! sign is:${sign}")
|
||||
}
|
||||
else -> {
|
||||
ToastUtils.showLong("和司机端连接异常!")
|
||||
Logger.d(TAG, "client statusCode is:${statusCode}")
|
||||
CallerLogger.d(
|
||||
"$M_ADAS_IMPL$TAG",
|
||||
"client statusCode is:${statusCode}"
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -138,17 +141,15 @@ class MoGoAutopilotProvider :
|
||||
AdasManager.getInstance().setOnMultiDeviceListener { bytes ->
|
||||
// 发送数据给乘客端
|
||||
if (NSDNettyManager.getInstance().isServerStart) {
|
||||
Logger.d(
|
||||
TAG,
|
||||
"司机端透传数据给乘客端!"
|
||||
)
|
||||
NSDNettyManager.getInstance()
|
||||
.sendMsgToAllClients(MogoProtocolMsg(NORMAL_DATA, bytes.size, bytes))
|
||||
} else {
|
||||
Logger.d(TAG, "司机端Server未启动!")
|
||||
CallerLogger.d("$M_ADAS_IMPL$TAG", "司机端Server未启动!")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
CallerLogger.i("$M_ADAS_IMPL$TAG", "initServer……")
|
||||
// 同步数据给工控机的服务
|
||||
AsyncDataToAutopilotServer.INSTANCE.initServer()
|
||||
// 同步是否开启美化模式
|
||||
@@ -188,32 +189,45 @@ class MoGoAutopilotProvider :
|
||||
|
||||
override fun onMapCollectStart(cmdId: Int, cmdTime: Long) {
|
||||
val result = recordPackage(2, cmdId)
|
||||
Logger.d(TAG, "开始记录包: [$cmdId, $result]")
|
||||
CallerLogger.d("$M_ADAS_IMPL$TAG", "开始记录包: [$cmdId, $result]")
|
||||
}
|
||||
|
||||
override fun onMapCollectEnd(cmdId: Int, cmdTime: Long) {
|
||||
val result = stopRecord(2, cmdId)
|
||||
Logger.d(TAG, "结束记录包: [$cmdId, $result]")
|
||||
CallerLogger.d("$M_ADAS_IMPL$TAG", "结束记录包: [$cmdId, $result]")
|
||||
}
|
||||
|
||||
override fun startAutoPilot(result: AutopilotControlParameters) {
|
||||
override fun startAutoPilot(controlParameters: AutopilotControlParameters) {
|
||||
if (AdasManager.getInstance().ipcConnectionStatus == Constants.IPC_CONNECTION_STATUS.CONNECTED) {
|
||||
val parameter = AutopilotControlCmdParameter("aiCloudToStartAutopilot", result)
|
||||
// AdasManager.getInstance().aiCloudToAdasData(GsonUtils.toJson(parameter)) //todo pb : 需要指定来源
|
||||
AdasManager.getInstance().sendAutoPilotModeReq(1, 1, controlParameters.toRouteInfo())
|
||||
} else {
|
||||
Logger.e(TAG, "车机与工控机链接失败,无法开启自动驾驶")
|
||||
CallerLogger.e("$M_ADAS_IMPL$TAG", "车机与工控机链接失败,无法开启自动驾驶")
|
||||
}
|
||||
}
|
||||
|
||||
override fun sendTrafficLightData(trafficLightResult: TrafficLightResult) {
|
||||
AdasManager.getInstance().sendTrafficLightData(
|
||||
trafficLightResult.crossId,
|
||||
trafficLightResult.lat,
|
||||
trafficLightResult.lon,
|
||||
trafficLightResult.heading,
|
||||
trafficLightResult.direction,
|
||||
trafficLightResult.lightId,
|
||||
trafficLightResult.laneNo,
|
||||
trafficLightResult.arrowNo,
|
||||
trafficLightResult.flashYellow,
|
||||
trafficLightResult.toTrafficLightDetail()
|
||||
)
|
||||
}
|
||||
|
||||
override fun sendMessageToAutopilot(jsonString: String) {
|
||||
// AdasManager.getInstance().sendMessage(jsonString) //todo pb : 红绿灯
|
||||
}
|
||||
|
||||
override fun cancelAutoPilot() {
|
||||
if (AdasManager.getInstance().ipcConnectionStatus == Constants.IPC_CONNECTION_STATUS.CONNECTED) {
|
||||
// AdasManager.getInstance().controlAutopilotCarHead() //todo pb : 需要指定来源
|
||||
AdasManager.getInstance().sendAutoPilotModeReq(0, 1, null)
|
||||
} else {
|
||||
Logger.e(TAG, "车机与工控机链接失败,无法断开自动驾驶")
|
||||
CallerLogger.e("$M_ADAS_IMPL$TAG", "车机与工控机链接失败,无法断开自动驾驶")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -295,9 +309,23 @@ class MoGoAutopilotProvider :
|
||||
*/
|
||||
override fun setControlAutopilotCarAuto(isEnable: Boolean) {
|
||||
if (isEnable) {
|
||||
// AdasManager.getInstance().sendAutoPilotModeReq() //todo pb : 需要指定来源
|
||||
AdasManager.getInstance().sendAutoPilotModeReq(1, 0, null)
|
||||
} else {
|
||||
// AdasManager.getInstance().sendAutoPilotModeReq() //todo pb : 需要指定来源
|
||||
AdasManager.getInstance().sendAutoPilotModeReq(0, 0, null)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 请求工控机基础配置信息
|
||||
*/
|
||||
override fun getCarConfig() {
|
||||
AdasManager.getInstance().sendCarConfigReq()
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取全局路径
|
||||
*/
|
||||
override fun getGlobalPath() {
|
||||
AdasManager.getInstance().sendGlobalPathReq()
|
||||
}
|
||||
}
|
||||
@@ -15,6 +15,7 @@ import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_ALIAS_C
|
||||
import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_ALIAS_CODE_ADAS_MESSAGE_RECT_DATA
|
||||
import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_LINK_ADAS
|
||||
import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_LINK_LOG_WEB_SOCKET_DATA
|
||||
import com.mogo.eagle.core.data.deva.scene.SceneConstant.Companion.M_ADAS
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager.getAutoPilotStatusInfo
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager.invokeArriveAtStation
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager.invokeAutoPilotStatus
|
||||
@@ -28,10 +29,9 @@ import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotIdentifyListen
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotPlanningListenerManager.invokeAutopilotRotting
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotPlanningListenerManager.invokeAutopilotTrajectory
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotVehicleStateListenerManager
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager.showAdUpgradeStatus
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager.showDockerRebootResult
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.Logger
|
||||
import com.mogo.eagle.core.function.call.logger.CallerLogger
|
||||
import com.mogo.module.common.MogoApisHandler
|
||||
import com.mogo.module.common.datacenter.SnapshotLocationDataCenter
|
||||
import com.mogo.module.service.MarkerServiceHandler
|
||||
@@ -49,7 +49,7 @@ import record_cache.RecordPanelOuterClass
|
||||
import java.util.*
|
||||
|
||||
/**
|
||||
* @author emarrow
|
||||
* @author emArrow
|
||||
* @since 2022/3/11
|
||||
*
|
||||
*
|
||||
@@ -172,8 +172,9 @@ class MoGoAdasListenerImpl : OnAdasListener {
|
||||
autopilotStatusInfo.connectIP = AdasManager.getInstance().ipcConnectedIp
|
||||
}
|
||||
if (autopilotStatusInfo.dockVersion == null) {
|
||||
// autopilotStatusInfo.dockVersion =
|
||||
// AdasManager.getInstance() //todo pb : get docker
|
||||
AdasManager.getInstance().carConfig?.let {
|
||||
autopilotStatusInfo.dockVersion = it.dockVersion
|
||||
}
|
||||
}
|
||||
invokeAutoPilotStatus()
|
||||
}
|
||||
@@ -278,8 +279,8 @@ class MoGoAdasListenerImpl : OnAdasListener {
|
||||
|
||||
override fun onUpgradeStateInfo(info: IPCUpgradeStateInfo) {
|
||||
if (info != null) {
|
||||
Logger.d(
|
||||
TAG, "onUpgradeStateInfo " +
|
||||
CallerLogger.d(
|
||||
"$M_ADAS$TAG", "onUpgradeStateInfo " +
|
||||
" upgrade mode=" + info.upgradeMode +
|
||||
" download status=" + info.downloadStatus +
|
||||
" download progress current=" + info.progress.current +
|
||||
@@ -292,7 +293,7 @@ class MoGoAdasListenerImpl : OnAdasListener {
|
||||
info.progress.total, info.images, info.upgradeStatus
|
||||
)
|
||||
} else {
|
||||
Logger.d(TAG, "onUpgradeStateInfo : upgrade state info is null")
|
||||
CallerLogger.w("$M_ADAS$TAG", "onUpgradeStateInfo : upgrade state info is null")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -300,7 +301,7 @@ class MoGoAdasListenerImpl : OnAdasListener {
|
||||
if (info != null && "docker restart autocar_default_1" == info.cmd) {
|
||||
showDockerRebootResult(info.code, info.msg)
|
||||
} else {
|
||||
Logger.d(TAG, "onSSHResult : result info is null")
|
||||
CallerLogger.w("$M_ADAS$TAG", "onSSHResult : result info is null")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -3,10 +3,11 @@ package com.mogo.eagle.core.function.autopilot.adapter
|
||||
import com.mogo.cloud.passport.MoGoAiCloudClientConfig
|
||||
import com.mogo.commons.debug.DebugConfig
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotStatusInfo
|
||||
import com.mogo.eagle.core.data.deva.scene.SceneConstant.Companion.M_ADAS_IMPL
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener
|
||||
import com.mogo.eagle.core.function.autopilot.network.AdasServiceModel
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.Logger
|
||||
import com.mogo.eagle.core.function.call.logger.CallerLogger
|
||||
import com.zhidao.support.adas.high.AdasManager
|
||||
import com.zhidao.support.adas.high.OnAdasConnectStatusListener
|
||||
import com.zhidao.support.adas.high.common.Constants
|
||||
@@ -18,12 +19,10 @@ import java.util.concurrent.TimeUnit
|
||||
|
||||
/**
|
||||
* ADAS-SDK与工控机连接状态回调
|
||||
*
|
||||
* @author donghongyu
|
||||
*/
|
||||
class MoGoAdasMsgConnectStatusListenerImpl : OnAdasConnectStatusListener,
|
||||
IMoGoAutopilotStatusListener {
|
||||
private val TAG = "MoGoAdasMsgConnectStatusListenerImpl"
|
||||
private val TAG = "ConnectStatus"
|
||||
|
||||
//自动驾驶状态
|
||||
private var mCurrentAutopilotStatus = -1
|
||||
@@ -34,7 +33,7 @@ class MoGoAdasMsgConnectStatusListenerImpl : OnAdasConnectStatusListener,
|
||||
|
||||
override fun onConnectionIPCStatus(ipcConnectionStatus: Int, reason: String?) {
|
||||
if (ipcConnectionStatus == Constants.IPC_CONNECTION_STATUS.CONNECTED) {
|
||||
Logger.d(TAG, "webSocket 连接成功")
|
||||
CallerLogger.d("$M_ADAS_IMPL$TAG", "webSocket 连接成功")
|
||||
// 初始化自动驾驶状态信息
|
||||
CallerAutoPilotStatusListenerManager.getAutoPilotStatusInfo().connectIP =
|
||||
AdasManager.getInstance().ipcConnectedIp
|
||||
@@ -47,17 +46,17 @@ class MoGoAdasMsgConnectStatusListenerImpl : OnAdasConnectStatusListener,
|
||||
// 开启轮训上传自动驾驶状态
|
||||
updateDriveStatusTask()
|
||||
} else if (ipcConnectionStatus == Constants.IPC_CONNECTION_STATUS.DISCONNECTED) {
|
||||
Logger.d(TAG, "webSocket 连接失败 reason:$reason")
|
||||
CallerLogger.d("$M_ADAS_IMPL$TAG", "webSocket 连接失败 reason:$reason")
|
||||
CallerAutoPilotStatusListenerManager.getAutoPilotStatusInfo().connectIP =
|
||||
AdasManager.getInstance().ipcConnectedIp
|
||||
CallerAutoPilotStatusListenerManager.getAutoPilotStatusInfo().connectStatus = false
|
||||
CallerAutoPilotStatusListenerManager.invokeAutoPilotStatus()
|
||||
} else if (ipcConnectionStatus == Constants.IPC_CONNECTION_STATUS.CONNECTING) {
|
||||
Logger.d(TAG, "webSocket 正在连接")
|
||||
CallerLogger.d("$M_ADAS_IMPL$TAG", "webSocket 正在连接")
|
||||
} else if (ipcConnectionStatus == Constants.IPC_CONNECTION_STATUS.SEARCH_ADDRESS) {
|
||||
Logger.d(TAG, "webSocket 正在搜索工控机IP")
|
||||
CallerLogger.d("$M_ADAS_IMPL$TAG", "webSocket 正在搜索工控机IP")
|
||||
} else if (ipcConnectionStatus == Constants.IPC_CONNECTION_STATUS.NOT_FOUND_ADDRESS) {
|
||||
Logger.d(TAG, "webSocket 找不到可用IP 传入的IP不可用或固定IP列表中所有IP不可用")
|
||||
CallerLogger.d("$M_ADAS_IMPL$TAG", "webSocket 找不到可用IP 传入的IP不可用或固定IP列表中所有IP不可用")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -88,7 +87,7 @@ class MoGoAdasMsgConnectStatusListenerImpl : OnAdasConnectStatusListener,
|
||||
* 同步SN信息给工控机
|
||||
*/
|
||||
private fun syncBasicInfoToAutopilot() {
|
||||
Logger.d(TAG, "同步PAD的SN给工控机……")
|
||||
CallerLogger.d("$M_ADAS_IMPL$TAG", "同步PAD的SN给工控机……")
|
||||
// 设置PAD-SN给工控,网络环境
|
||||
AdasManager.getInstance()
|
||||
.sendBasicInfoResp(MoGoAiCloudClientConfig.getInstance().sn, DebugConfig.getNetMode())
|
||||
@@ -98,7 +97,7 @@ class MoGoAdasMsgConnectStatusListenerImpl : OnAdasConnectStatusListener,
|
||||
* 上传自动驾驶状态任务
|
||||
*/
|
||||
private fun updateDriveStatusTask() {
|
||||
Logger.d(TAG, "updateDriveStatusTask")
|
||||
CallerLogger.d("$M_ADAS_IMPL$TAG", "updateDriveStatusTask")
|
||||
Flowable.interval(0, 5, TimeUnit.SECONDS)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.unsubscribeOn(Schedulers.io())
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.mogo.eagle.core.function.autopilot.entity;
|
||||
|
||||
/**
|
||||
* Created by XuYong on 2021/5/28 16:12
|
||||
* Created by SuYong on 2021/5/28 16:12
|
||||
*/
|
||||
public class AutonomousDriveStatusBean {
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.mogo.eagle.core.function.autopilot.entity;
|
||||
|
||||
/**
|
||||
* Created by XuYong on 2021/5/31 16:24
|
||||
* Created by SuYong on 2021/5/31 16:24
|
||||
*/
|
||||
public class ReportSiteBean {
|
||||
private String sn;
|
||||
|
||||
@@ -8,7 +8,6 @@ import com.mogo.eagle.core.function.autopilot.entity.ReportSiteBean;
|
||||
import com.mogo.eagle.core.network.RequestOptions;
|
||||
import com.mogo.eagle.core.network.SubscribeImpl;
|
||||
import com.mogo.eagle.core.network.utils.GsonUtil;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.Logger;
|
||||
import com.mogo.module.common.MogoApisHandler;
|
||||
import com.mogo.module.common.constants.HostConst;
|
||||
|
||||
@@ -89,7 +88,6 @@ public class AdasServiceModel {
|
||||
@Override
|
||||
public void onSuccess(BaseData o) {
|
||||
super.onSuccess(o);
|
||||
Logger.d(TAG, "autopilotArrive success");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1,12 +1,9 @@
|
||||
package com.mogo.eagle.core.function.autopilot.server
|
||||
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotControlCmdParameter
|
||||
import com.mogo.eagle.core.data.trafficlight.TrafficLightResult
|
||||
import com.mogo.eagle.core.function.api.trafficlight.IMoGoTrafficLightListener
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager
|
||||
import com.mogo.eagle.core.function.call.trafficlight.CallTrafficLightListenerManager
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.Logger
|
||||
import com.mogo.eagle.core.utilcode.util.GsonUtils
|
||||
|
||||
/**
|
||||
* @author xiaoyuzhou
|
||||
@@ -25,12 +22,10 @@ class AsyncDataToAutopilotServer private constructor() : IMoGoTrafficLightListen
|
||||
}
|
||||
|
||||
fun initServer() {
|
||||
Logger.d(TAG, "initServer……")
|
||||
CallTrafficLightListenerManager.registerTrafficLightListener(TAG, this)
|
||||
}
|
||||
|
||||
override fun onTrafficLightStatus(trafficLightResult: TrafficLightResult) {
|
||||
val autopilotControlCmdParameter = AutopilotControlCmdParameter("light", trafficLightResult)
|
||||
CallerAutoPilotManager.sendDataToAutopilot(GsonUtils.toJson(autopilotControlCmdParameter))
|
||||
CallerAutoPilotManager.sendTrafficLightData(trafficLightResult)
|
||||
}
|
||||
}
|
||||
@@ -1,8 +1,9 @@
|
||||
package com.mogo.eagle.core.function.chat.facade.aop
|
||||
|
||||
import android.os.Looper
|
||||
import android.util.Log
|
||||
import com.mogo.commons.debug.DebugConfig
|
||||
import com.mogo.eagle.core.data.deva.scene.SceneConstant.Companion.M_CHAT
|
||||
import com.mogo.eagle.core.function.call.logger.CallerLogger
|
||||
import org.aspectj.lang.ProceedingJoinPoint
|
||||
import org.aspectj.lang.reflect.CodeSignature
|
||||
import org.aspectj.lang.reflect.MethodSignature
|
||||
@@ -37,7 +38,7 @@ open class BaseAspectj {
|
||||
if (Looper.myLooper() != Looper.getMainLooper()) {
|
||||
builder.append("[Thread:\"").append(Thread.currentThread().name).append("\"]")
|
||||
}
|
||||
Log.i(asTag(cls), builder.toString())
|
||||
CallerLogger.d(M_CHAT + asTag(cls), builder.toString())
|
||||
}
|
||||
|
||||
fun exitMethod(joinPoint: ProceedingJoinPoint, result: Any?, lengthMill: Long) {
|
||||
@@ -50,10 +51,10 @@ open class BaseAspectj {
|
||||
&& signature.returnType != Void.TYPE
|
||||
|
||||
val builder = StringBuilder("\u21E0 ")
|
||||
.append(methodName)
|
||||
.append("[")
|
||||
.append(lengthMill)
|
||||
.append("ms]")
|
||||
.append(methodName)
|
||||
.append("[")
|
||||
.append(lengthMill)
|
||||
.append("ms]")
|
||||
|
||||
if (hasReturnType) {
|
||||
builder.append(" = ")
|
||||
@@ -61,7 +62,7 @@ open class BaseAspectj {
|
||||
result.toString()
|
||||
})
|
||||
}
|
||||
Log.i(asTag(cls), builder.toString())
|
||||
CallerLogger.d(M_CHAT + asTag(cls), builder.toString())
|
||||
}
|
||||
|
||||
private fun asTag(cls: Class<*>): String {
|
||||
|
||||
@@ -33,7 +33,6 @@ class VehicleMonitoringManager : ICheckProvider, IMogoStatusChangedListener {
|
||||
private var hasTipShow = false //是否已经弹框提示
|
||||
var dialog: CheckDialog? = null
|
||||
override fun init(context: Context) {
|
||||
LogUtils.dTag(TAG, "初始化 CheckProvider 模块")
|
||||
mContext = context
|
||||
MogoApisHandler.getInstance().apis.statusManagerApi.registerStatusChangedListener(
|
||||
TAG,
|
||||
|
||||
@@ -7,7 +7,6 @@ import android.animation.ObjectAnimator;
|
||||
import android.animation.ValueAnimator;
|
||||
import android.graphics.Rect;
|
||||
import android.os.Bundle;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.ProgressBar;
|
||||
@@ -91,20 +90,15 @@ public class CheckActivity extends AppCompatActivity {
|
||||
mRecyclerView.setAdapter(mCheckAdapter);
|
||||
}
|
||||
|
||||
|
||||
private void checkAction() {
|
||||
CheckNetWork.INSTANCE.checkNetWork(this.getApplicationContext(), new ICheckResultCallBack() {
|
||||
@Override
|
||||
public void callBackWithCheckData(CheckResultData data) {
|
||||
Log.d("CheckActivity", "车辆自检结果是:" + data.toString());
|
||||
ThreadUtils.runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (data != null && mCheckAdapter != null) {
|
||||
mCheckAdapter.errorMsg = null;
|
||||
mCheckAdapter.mCheckResultData = data;
|
||||
mCheckAdapter.notifyDataSetChanged();
|
||||
}
|
||||
ThreadUtils.runOnUiThread(() -> {
|
||||
if (data != null && mCheckAdapter != null) {
|
||||
mCheckAdapter.errorMsg = null;
|
||||
mCheckAdapter.mCheckResultData = data;
|
||||
mCheckAdapter.notifyDataSetChanged();
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -121,7 +115,6 @@ public class CheckActivity extends AppCompatActivity {
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* **************************************************************************************检测动画
|
||||
*/
|
||||
@@ -180,16 +173,12 @@ public class CheckActivity extends AppCompatActivity {
|
||||
public void animatorScanCarBorder(boolean show, int weight) {
|
||||
if (show) {
|
||||
mValueAnimator = ValueAnimator.ofInt(0, weight);
|
||||
} else {
|
||||
}
|
||||
mValueAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
|
||||
@Override
|
||||
public void onAnimationUpdate(ValueAnimator animation) {
|
||||
Rect rect = new Rect(0, 0, (int) mValueAnimator.getAnimatedValue(), scanTopImageView.getHeight());
|
||||
setProgressBarRefresh((int) mValueAnimator.getAnimatedValue());
|
||||
scanTopImageView.setClip(rect);
|
||||
tipsImageView.setClip(rect);
|
||||
}
|
||||
mValueAnimator.addUpdateListener(animation -> {
|
||||
Rect rect = new Rect(0, 0, (int) mValueAnimator.getAnimatedValue(), scanTopImageView.getHeight());
|
||||
setProgressBarRefresh((int) mValueAnimator.getAnimatedValue());
|
||||
scanTopImageView.setClip(rect);
|
||||
tipsImageView.setClip(rect);
|
||||
});
|
||||
mValueAnimator.setDuration(DURATION_TIME);
|
||||
mValueAnimator.start();
|
||||
@@ -200,7 +189,7 @@ public class CheckActivity extends AppCompatActivity {
|
||||
*/
|
||||
public void setProgressBarRefresh(int animateValue) {
|
||||
if (mProgressBar != null) {
|
||||
double scale = new BigDecimal((float) animateValue / scanBottomCarImage.getWidth())
|
||||
double scale = BigDecimal.valueOf((float) animateValue / scanBottomCarImage.getWidth())
|
||||
.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue() * 100;
|
||||
if (mProgressBar.getProgress() < 100) {
|
||||
mProgressBar.setProgress((int) scale);
|
||||
@@ -231,7 +220,7 @@ public class CheckActivity extends AppCompatActivity {
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
super.onDestroy();
|
||||
mCheckAdapter.ondestry();
|
||||
mCheckAdapter.onDestroy();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package com.mogo.eagle.core.function.check.view;
|
||||
|
||||
import android.content.Context;
|
||||
import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
@@ -23,7 +22,6 @@ import com.mogo.eagle.core.function.check.net.CheckResultData;
|
||||
*/
|
||||
public class CheckAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
|
||||
|
||||
private static final String TAG = "CheckActivity";
|
||||
LayoutInflater mLayoutInflater;
|
||||
CheckResultData mCheckResultData;
|
||||
private Context mContext;
|
||||
@@ -51,13 +49,11 @@ public class CheckAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder>
|
||||
if (viewType == CheckItemInfo.CheckAdapterStyleEnum.ITEM_TYPE_CHECK_TITLE) {
|
||||
View v = mLayoutInflater.inflate(R.layout.check_titel, parent,
|
||||
false);
|
||||
CheckTitleViewHolder holder = new CheckTitleViewHolder(v);
|
||||
return holder;
|
||||
return new CheckTitleViewHolder(v);
|
||||
}
|
||||
View v = mLayoutInflater.inflate(R.layout.check_list, parent,
|
||||
false);
|
||||
CheckListViewHolder holder = new CheckListViewHolder(v);
|
||||
return holder;
|
||||
return new CheckListViewHolder(v);
|
||||
}
|
||||
|
||||
public void dismissDialog() {
|
||||
@@ -66,7 +62,7 @@ public class CheckAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder>
|
||||
}
|
||||
}
|
||||
|
||||
public void ondestry() {
|
||||
public void onDestroy() {
|
||||
mContext = null;
|
||||
mCheckInfoListDialog = null;
|
||||
}
|
||||
@@ -74,9 +70,9 @@ public class CheckAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder>
|
||||
/**
|
||||
* 顶部view列表
|
||||
*/
|
||||
class CheckTitleViewHolder extends RecyclerView.ViewHolder {
|
||||
private ImageView errorImage;
|
||||
private TextView mTextView;
|
||||
private static class CheckTitleViewHolder extends RecyclerView.ViewHolder {
|
||||
private final ImageView errorImage;
|
||||
private final TextView mTextView;
|
||||
|
||||
public CheckTitleViewHolder(@NonNull View itemView) {
|
||||
super(itemView);
|
||||
@@ -88,11 +84,11 @@ public class CheckAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder>
|
||||
/**
|
||||
* 版本->软件检测
|
||||
*/
|
||||
class CheckListViewHolder extends RecyclerView.ViewHolder {
|
||||
private TextView viewTitle;
|
||||
private static class CheckListViewHolder extends RecyclerView.ViewHolder {
|
||||
private final TextView viewTitle;
|
||||
private TextView iconAutoTitle;
|
||||
private TextView autoRiskState;
|
||||
private ImageView iconAuto;
|
||||
private final TextView autoRiskState;
|
||||
private final ImageView iconAuto;
|
||||
|
||||
public CheckListViewHolder(@NonNull View itemView) {
|
||||
super(itemView);
|
||||
@@ -135,7 +131,6 @@ public class CheckAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder>
|
||||
((CheckListViewHolder) holder).autoRiskState.setText("存在异常项");
|
||||
}
|
||||
((CheckListViewHolder) holder).iconAuto.setOnClickListener(v -> {
|
||||
Log.d(TAG, "硬件检测结果:");
|
||||
if (mCheckInfoListDialog != null) {
|
||||
mCheckInfoListDialog.dismiss();
|
||||
}
|
||||
@@ -155,7 +150,6 @@ public class CheckAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder>
|
||||
((CheckListViewHolder) holder).autoRiskState.setText("存在异常项");
|
||||
}
|
||||
((CheckListViewHolder) holder).iconAuto.setOnClickListener(v -> {
|
||||
Log.d(TAG, "系统检测结果:");
|
||||
if (mCheckInfoListDialog != null) {
|
||||
mCheckInfoListDialog.dismiss();
|
||||
}
|
||||
|
||||
@@ -19,9 +19,7 @@ import com.mogo.module.common.dialog.BaseFloatDialog;
|
||||
*/
|
||||
public class CheckDialog extends BaseFloatDialog {
|
||||
|
||||
private ImageView cancel;
|
||||
private boolean showWarning;
|
||||
private TextView checkDetail;
|
||||
private Context mContext;
|
||||
|
||||
public CheckDialog(@NonNull Context context, boolean hasError) {
|
||||
@@ -37,11 +35,11 @@ public class CheckDialog extends BaseFloatDialog {
|
||||
|
||||
public void initView() {
|
||||
setContentView(R.layout.check_dialog);
|
||||
cancel = findViewById(R.id.cancel_button);
|
||||
ImageView cancel = findViewById(R.id.cancel_button);
|
||||
cancel.setOnClickListener(v -> {
|
||||
dismiss();
|
||||
});
|
||||
checkDetail = findViewById(R.id.check_detail);
|
||||
TextView checkDetail = findViewById(R.id.check_detail);
|
||||
checkDetail.setOnClickListener(v -> {
|
||||
dismiss();
|
||||
if (mContext != null) {
|
||||
@@ -50,17 +48,15 @@ public class CheckDialog extends BaseFloatDialog {
|
||||
});
|
||||
|
||||
//根据条件显示体检页面/风险提示
|
||||
if (showWarning == true) {
|
||||
if (showWarning) {
|
||||
findViewById(R.id.error_view).setVisibility(View.VISIBLE);
|
||||
findViewById(R.id.check_view).setVisibility(View.INVISIBLE);
|
||||
|
||||
} else {
|
||||
findViewById(R.id.error_view).setVisibility(View.INVISIBLE);
|
||||
findViewById(R.id.check_view).setVisibility(View.VISIBLE);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void cancel() {
|
||||
|
||||
}
|
||||
|
||||
@@ -5,7 +5,6 @@ import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.ScrollView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
@@ -25,14 +24,14 @@ public class CheckInfoAdapter extends RecyclerView.Adapter {
|
||||
LayoutInflater mLayoutInflater;
|
||||
private Context mContext;
|
||||
private String mStyle;
|
||||
private List<CheckResultData.CheckListItem> showData;
|
||||
private final List<CheckResultData.CheckListItem> showData;
|
||||
//item类型
|
||||
public static final int ITEM_TYPE_CONTENT = 0;//内容
|
||||
public static final int ITEM_TYPE_BOTTOM = 1;//footer类型
|
||||
//适配UI的空白表格
|
||||
private int mBottomCount = 0;
|
||||
|
||||
public CheckInfoAdapter(Context context, String style, List checkResultData) {
|
||||
public CheckInfoAdapter(Context context, String style, List<CheckResultData.CheckListItem> checkResultData) {
|
||||
mContext = context;
|
||||
mStyle = style;
|
||||
showData = checkResultData;
|
||||
@@ -50,7 +49,7 @@ public class CheckInfoAdapter extends RecyclerView.Adapter {
|
||||
}
|
||||
View v = mLayoutInflater.inflate(R.layout.check_info_adapter, parent,
|
||||
false);
|
||||
CheckInfoAdapter.CheckInfoViewHolder holder = new CheckInfoAdapter.CheckInfoViewHolder(v);
|
||||
CheckInfoAdapter.CheckInfoViewHolder holder = new CheckInfoViewHolder(v);
|
||||
return holder;
|
||||
}
|
||||
|
||||
@@ -62,7 +61,7 @@ public class CheckInfoAdapter extends RecyclerView.Adapter {
|
||||
if (position < showData.size() * 2) {
|
||||
int index = position / 2;
|
||||
CheckResultData.CheckListItem positionItem = showData.get(index);
|
||||
if (isEven(position) == true) {//偶数隐藏图片显示检测指标
|
||||
if (isEven(position)) {//偶数隐藏图片显示检测指标
|
||||
((CheckInfoViewHolder) holder).checkIcon.setVisibility(View.GONE);
|
||||
((CheckInfoViewHolder) holder).mTextView.setText(positionItem.getName());
|
||||
} else {//奇数显示图片和检测指标结果
|
||||
@@ -105,9 +104,9 @@ public class CheckInfoAdapter extends RecyclerView.Adapter {
|
||||
return showData.size() * 2 + mBottomCount;
|
||||
}
|
||||
|
||||
public class CheckInfoViewHolder extends RecyclerView.ViewHolder {
|
||||
private ImageView checkIcon;
|
||||
private TextView mTextView;
|
||||
private static class CheckInfoViewHolder extends RecyclerView.ViewHolder {
|
||||
private final ImageView checkIcon;
|
||||
private final TextView mTextView;
|
||||
|
||||
public CheckInfoViewHolder(View v) {
|
||||
super(v);
|
||||
@@ -116,7 +115,7 @@ public class CheckInfoAdapter extends RecyclerView.Adapter {
|
||||
}
|
||||
}
|
||||
|
||||
public class CheckInfoFooter extends RecyclerView.ViewHolder {
|
||||
private static class CheckInfoFooter extends RecyclerView.ViewHolder {
|
||||
public CheckInfoFooter(View v) {
|
||||
super(v);
|
||||
}
|
||||
|
||||
@@ -6,7 +6,6 @@ import android.graphics.Canvas;
|
||||
import android.graphics.Rect;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.graphics.drawable.GradientDrawable;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
|
||||
import androidx.recyclerview.widget.GridLayoutManager;
|
||||
@@ -19,9 +18,8 @@ import androidx.recyclerview.widget.StaggeredGridLayoutManager;
|
||||
* @since: 9/22/21
|
||||
*/
|
||||
public class CheckInfoGridItemDivider extends RecyclerView.ItemDecoration {
|
||||
private String TAG = getClass().getSimpleName();
|
||||
private static final int[] ATTRS = new int[]{android.R.attr.listDivider};
|
||||
private Drawable divider;
|
||||
private final Drawable divider;
|
||||
|
||||
public CheckInfoGridItemDivider(Context context) {
|
||||
final TypedArray a = context.obtainStyledAttributes(ATTRS);
|
||||
@@ -44,7 +42,6 @@ public class CheckInfoGridItemDivider extends RecyclerView.ItemDecoration {
|
||||
|
||||
@Override
|
||||
public void onDraw(Canvas c, RecyclerView parent, RecyclerView.State state) {
|
||||
|
||||
drawHorizontal(c, parent);
|
||||
drawVertical(c, parent);
|
||||
|
||||
@@ -138,10 +135,7 @@ public class CheckInfoGridItemDivider extends RecyclerView.ItemDecoration {
|
||||
|
||||
//是否为第一行
|
||||
private boolean isFirstRaw(int pos, int spanCount) {
|
||||
if (pos < spanCount) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
return pos < spanCount;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -63,7 +63,7 @@ public class CheckInfoListDialog extends BaseFloatDialog {
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
List resultData = showInfoResult();
|
||||
List<CheckResultData.CheckListItem> resultData = showInfoResult();
|
||||
CheckInfoAdapter adapter = new CheckInfoAdapter(mContext, mStyle, resultData);
|
||||
mRecyclerView.setAdapter(adapter);
|
||||
//关闭按钮
|
||||
@@ -72,13 +72,13 @@ public class CheckInfoListDialog extends BaseFloatDialog {
|
||||
});
|
||||
}
|
||||
|
||||
public List showInfoResult() {
|
||||
public List<CheckResultData.CheckListItem> showInfoResult() {
|
||||
|
||||
if (result.size() > 0) {
|
||||
result.clear();
|
||||
}
|
||||
try {
|
||||
List<CheckResultData.CheckListItem> checkListResult = new ArrayList();
|
||||
List<CheckResultData.CheckListItem> checkListResult = new ArrayList<CheckResultData.CheckListItem>();
|
||||
try {
|
||||
if (mStyle.equals(CheckItemInfo.CheckInfoStyle.CHECK_INFO_STYLE_DEVICES)) {
|
||||
checkListResult = mCheckResultData.getData().getDevices();
|
||||
|
||||
@@ -15,8 +15,8 @@ import com.mogo.eagle.core.function.check.R;
|
||||
* @since: 9/29/21
|
||||
*/
|
||||
public class CheckInfoRecyclerView extends RecyclerView {
|
||||
private int maxHeight = (int) getContext().getResources().getDimension(R.dimen.check_height);
|
||||
private int maxWeight = (int) getContext().getResources().getDimension(R.dimen.check_width);
|
||||
private final int maxHeight = (int) getContext().getResources().getDimension(R.dimen.check_height);
|
||||
private final int maxWeight = (int) getContext().getResources().getDimension(R.dimen.check_width);
|
||||
|
||||
public CheckInfoRecyclerView(@NonNull Context context) {
|
||||
super(context);
|
||||
|
||||
@@ -51,6 +51,7 @@ import com.mogo.map.uicontroller.VisualAngleMode.*
|
||||
import com.mogo.module.common.MogoApisHandler
|
||||
import kotlinx.android.synthetic.main.view_debug_setting.view.*
|
||||
import mogo.telematics.pad.MessagePad
|
||||
import mogo_msg.MogoReportMsg
|
||||
import java.util.*
|
||||
|
||||
/**
|
||||
@@ -581,6 +582,10 @@ class DebugSettingView @JvmOverloads constructor(
|
||||
|
||||
}
|
||||
|
||||
override fun onAutopilotGuardian(guardianInfo: MogoReportMsg.MogoReportMessage?) {
|
||||
//todo pb : 工控机异常信息回调
|
||||
|
||||
}
|
||||
|
||||
override fun onLocationChanged(location: MogoLocation?) {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user