This commit is contained in:
zhongchao
2022-03-14 14:11:29 +08:00
parent 3ffcb4bd27
commit d35700cb08
32 changed files with 332 additions and 1874 deletions

View File

@@ -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()
}
}

View File

@@ -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")
}
}

View File

@@ -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())

View File

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

View File

@@ -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;

View File

@@ -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");
}
});
}

View File

@@ -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)
}
}

View File

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

View File

@@ -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,

View File

@@ -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();
}
}

View File

@@ -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();
}

View File

@@ -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() {
}

View File

@@ -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);
}

View File

@@ -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

View File

@@ -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();

View File

@@ -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);

View File

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

View File

@@ -1,28 +0,0 @@
package com.mogo.eagle.core.data.autopilot;
/**
* @author congtaowang
* @since 2020/10/22
*
* 域控制器 控制指令发送
*
*/
public class AutopilotControlCmdParameter {
public String action;
public Object result;
public AutopilotControlCmdParameter(String action, Object result) {
this.action = action;
this.result = result;
}
@Override
public String toString() {
return "AutoPilotControlCmdParameter{" +
"action='" + action + '\'' +
", result=" + result +
'}';
}
}

View File

@@ -1,79 +0,0 @@
package com.mogo.eagle.core.data.autopilot;
import java.util.List;
/**
* @author donghongyu
* @since 2021/09/22
* <p>
* 启动自动驾驶参数
* <p>
* {
* "action": "aiCloudToStartAutopilot",
* "result": {
* "endLatLon": {
* "lat": 40.2023065,
* "lon": 116.7328583
* },
* "isSpeakVoice": false,
* "speedLimit": 0.0,
* "startLatLon": {
* "lat": 40.20070823669507,
* "lon": 116.73264342448671
* },
* "startName": "HYKXC",
* "endName": "HYJC",
* "vehicleType": 10,
* "wayLatLons": null
* }
* }
*/
public class AutopilotControlParameters {
public String startName="";
public String endName="";
public AutoPilotLonLat startLatLon;
public List<AutoPilotLonLat> wayLatLons;
public AutoPilotLonLat endLatLon;
public float speedLimit;
public int vehicleType;// 运营类型
/**
* 是否播放adas的 开始自动驾驶 语音
*/
public boolean isSpeakVoice = true;
public static class AutoPilotLonLat {
public double lat;
public double lon;
public AutoPilotLonLat() {
}
public AutoPilotLonLat(double lat, double lon) {
this.lat = lat;
this.lon = lon;
}
@Override
public String toString() {
return "AutoPilotLonLat{" +
"lat=" + lat +
", lon=" + lon +
'}';
}
}
@Override
public String toString() {
return "AutopilotControlParameters{" +
"startName='" + startName + '\'' +
", endName='" + endName + '\'' +
", startLatLon=" + startLatLon +
", wayLatLons=" + wayLatLons +
", endLatLon=" + endLatLon +
", speedLimit=" + speedLimit +
", vehicleType=" + vehicleType +
", isSpeakVoice=" + isSpeakVoice +
'}';
}
}

View File

@@ -0,0 +1,116 @@
package com.mogo.eagle.core.data.autopilot
import com.mogo.eagle.core.data.autopilot.AutopilotControlParameters.AutoPilotLonLat
import mogo.telematics.pad.MessagePad
/**
* @author donghongyu
* @since 2021/09/22
*
*
* 启动自动驾驶参数
*
*
* {
* "action": "aiCloudToStartAutopilot",
* "result": {
* "endLatLon": {
* "lat": 40.2023065,
* "lon": 116.7328583
* },
* "isSpeakVoice": false,
* "speedLimit": 0.0,
* "startLatLon": {
* "lat": 40.20070823669507,
* "lon": 116.73264342448671
* },
* "startName": "HYKXC",
* "endName": "HYJC",
* "vehicleType": 10,
* "wayLatLons": null
* }
* }
*/
fun AutopilotControlParameters.toRouteInfo(): MessagePad.RouteInfo{
val routeInfo = MessagePad.RouteInfo.newBuilder()
val startLoc = routeInfo.startLocationBuilder
val endLoc = routeInfo.endLocationBuilder
this.startLatLon?.let {
startLoc.latitude = it.lat
startLoc.longitude = it.lon
}
this.endLatLon?.let {
endLoc.latitude = it.lat
endLoc.longitude = it.lon
}
this.wayLatLons?.forEach {
val locBuilder = MessagePad.Location.newBuilder()
locBuilder.latitude = it.lat
locBuilder.longitude = it.lon
routeInfo.addWayPoints(locBuilder.build())
}
routeInfo.startName = this.startName
routeInfo.endName = this.endName
routeInfo.vehicleType = this.vehicleType
routeInfo.isSpeakVoice = this.isSpeakVoice
routeInfo.speedLimit = this.speedLimit.toDouble()
routeInfo.startLocation = startLoc.build()
routeInfo.endLocation = endLoc.build()
return routeInfo.build()
}
class AutopilotControlParameters {
@JvmField
var startName = ""
@JvmField
var endName = ""
@JvmField
var startLatLon: AutoPilotLonLat? = null
@JvmField
var wayLatLons: List<AutoPilotLonLat>? = null
@JvmField
var endLatLon: AutoPilotLonLat? = null
var speedLimit = 0f
@JvmField
var vehicleType // 运营类型
= 0
/**
* 是否播放adas的 开始自动驾驶 语音
*/
@JvmField
var isSpeakVoice = true
class AutoPilotLonLat {
var lat = 0.0
var lon = 0.0
constructor() {}
constructor(lat: Double, lon: Double) {
this.lat = lat
this.lon = lon
}
override fun toString(): String {
return "AutoPilotLonLat{" +
"lat=" + lat +
", lon=" + lon +
'}'
}
}
override fun toString(): String {
return "AutopilotControlParameters{" +
"startName='" + startName + '\'' +
", endName='" + endName + '\'' +
", startLatLon=" + startLatLon +
", wayLatLons=" + wayLatLons +
", endLatLon=" + endLatLon +
", speedLimit=" + speedLimit +
", vehicleType=" + vehicleType +
", isSpeakVoice=" + isSpeakVoice +
'}'
}
}

View File

@@ -4,20 +4,22 @@ class SceneConstant {
companion object {
//lib包
const val M_ADAS = "lib-mogo-adas_"
const val M_ADAS = "LIB-ADAS_"
//核心module
const val M_NETWORK = "core-network_"
const val M_NETWORK = "CORE-NETWORK_"
//core业务module
const val M_DEVA = "core-impl-deva_"
const val M_OBU = "core-impl-obu_"
const val M_DISPATCH = "core-impl-dispatch_"
const val M_V2X = "core-impl-v2x_"
const val M_HMI = "core-impl-hmi_"
const val M_ADAS_IMPL = "CORE-ADAS_"
const val M_CHAT = "CORE-CHAT_"
const val M_DEVA = "CORE-DEVA_"
const val M_DISPATCH = "CORE-DISPATCH_"
const val M_HMI = "CORE-HMI_"
const val M_OBU = "CORE-OBU_"
const val M_V2X = "CORE-V2X_"
//旧module
const val M_ROUTE = "old-module-service_"
const val M_OTHER = "all-modules_"
const val M_ROUTE = "OLD-MODULE-SERVICE_"
const val M_OTHER = "ALL-MODULES_"
}
}

View File

@@ -1,5 +1,7 @@
package com.mogo.eagle.core.data.trafficlight
import mogo.telematics.pad.MessagePad
fun TrafficLightResult.currentRoadTrafficLight(): TrafficLightStatus? {
return TrafficLightStatusHelper.getCurrentRoadTrafficLight(this)
}
@@ -8,6 +10,23 @@ fun TrafficLightResult.currentRoadIsRight():Boolean{
return TrafficLightStatusHelper.currentRoadIsRight(this)
}
fun TrafficLightResult.toTrafficLightDetail():MessagePad.TrafficLightDetail{
val trafficLightBuilder = MessagePad.TrafficLightDetail.newBuilder()
val left = trafficLightBuilder.leftBuilder
val mid = trafficLightBuilder.midBuilder
val right = trafficLightBuilder.rightBuilder
left.phaseNo = this.laneList.left.phaseNo
left.color = this.laneList.left.color
left.remain = this.laneList.left.remain
mid.phaseNo = this.laneList.mid.phaseNo
mid.color = this.laneList.mid.color
mid.remain = this.laneList.mid.remain
right.phaseNo = this.laneList.right.phaseNo
right.color = this.laneList.right.color
right.remain = this.laneList.right.remain
return trafficLightBuilder.build()
}
/**
* 路口红绿灯请求返回数据
*/

View File

@@ -1,6 +1,7 @@
package com.mogo.eagle.core.function.api.autopilot
import com.mogo.eagle.core.data.autopilot.AutopilotControlParameters
import com.mogo.eagle.core.data.trafficlight.TrafficLightResult
import com.mogo.eagle.core.function.api.base.IMoGoFunctionServerProvider
/**
@@ -23,6 +24,11 @@ interface IMoGoAutopilotProvider : IMoGoFunctionServerProvider {
*/
fun startAutoPilot(controlParameters: AutopilotControlParameters)
/**
* 给工控机透出路口红绿灯信息
*/
fun sendTrafficLightData(trafficLightResult: TrafficLightResult)
/**
* 发送json数据给 Autopilot 自动驾驶控制器
* 具体的json格式需要与@宋克难 进行沟通
@@ -118,4 +124,16 @@ interface IMoGoAutopilotProvider : IMoGoFunctionServerProvider {
* isEnable = false 关闭
*/
fun setControlAutopilotCarAuto(isEnable: Boolean)
/**
* 查询工控机基础配置信息
*/
fun getCarConfig()
/**
* 获取全局路径
*/
fun getGlobalPath()
}

View File

@@ -3,6 +3,7 @@ package com.mogo.eagle.core.function.call.autopilot
import android.os.SystemClock
import com.mogo.eagle.core.data.autopilot.AutopilotControlParameters
import com.mogo.eagle.core.data.constants.MogoServicePaths
import com.mogo.eagle.core.data.trafficlight.TrafficLightResult
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotProvider
import com.mogo.eagle.core.function.call.base.CallerBase
import kotlin.random.Random
@@ -17,8 +18,8 @@ object CallerAutoPilotManager {
private val providerApi: IMoGoAutopilotProvider?
get() = CallerBase.getApiInstance(
IMoGoAutopilotProvider::class.java,
MogoServicePaths.PATH_AUTO_PILOT
IMoGoAutopilotProvider::class.java,
MogoServicePaths.PATH_AUTO_PILOT
)
/**
@@ -44,11 +45,10 @@ object CallerAutoPilotManager {
}
/**
* 发送json数据给 Autopilot 自动驾驶控制器
* 具体的json格式需要与@宋克难 进行沟通
* 发送红绿灯数据至工控机
*/
fun sendDataToAutopilot(jsonString: String) {
providerApi?.sendMessageToAutopilot(jsonString)
fun sendTrafficLightData(trafficLightResult: TrafficLightResult) {
providerApi?.sendTrafficLightData(trafficLightResult)
}
/**

View File

@@ -5,25 +5,25 @@ import com.mogo.eagle.core.utilcode.mogo.logger.Logger
object CallerLogger {
fun i(tag: String, message: String, any: Any) {
fun i(tag: String, message: String, any: Any? = null) {
if (scene.check(tag)) {
Logger.i(tag, message, any)
}
}
fun d(tag: String, message: String, any: Any) {
fun d(tag: String, message: String, any: Any? = null) {
if (scene.check(tag)) {
Logger.d(tag, message, any)
}
}
fun w(tag: String, message: String, any: Any) {
fun w(tag: String, message: String, any: Any? = null) {
if (scene.check(tag)) {
Logger.w(tag, message, any)
}
}
fun e(tag: String, message: String, any: Any) {
fun e(tag: String, message: String, any: Any? = null) {
if (scene.check(tag)) {
Logger.e(tag, message, any)
}

View File

@@ -0,0 +1,21 @@
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable
# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile

View File

@@ -50,7 +50,6 @@ public class AdasManager implements IAdasNetCommApi {
}
public void setCarConfig(MessagePad.CarConfigResp carConfig) {
this.carConfig = carConfig;
}
@@ -127,7 +126,6 @@ public class AdasManager implements IAdasNetCommApi {
}
}
/**
* 连接工控机
*/

View File

@@ -25,34 +25,34 @@ public class CupidLogUtils {
if (!mIsEnableLog) {
return;
}
Log.i(tag, msg);
Log.i("[tag=" + tag + "]", "[data=" + msg + "]");
}
public static void w(String tag, String msg) {
if (!mIsEnableLog) {
return;
}
Log.w(tag, msg);
Log.w("[tag=" + tag + "]", "[data=" + msg + "]");
}
public static void e(String tag, String msg) {
if (!mIsEnableLog) {
return;
}
Log.e(tag, msg);
Log.e("[tag=" + tag + "]", "[data=" + msg + "]");
}
public static void e(String msg) {
if (!mIsEnableLog) {
return;
}
Log.e("elita_lib", msg);
Log.e("[tag=elita_lib]", "[data=" + msg + "]");
}
public static void w(String msg) {
if (!mIsEnableLog) {
return;
}
Log.e("elita_lib", msg);
Log.e("[tag=elita_lib]", "[data=" + msg + "]");
}
}

View File

@@ -1,63 +0,0 @@
package com.zhidao.support.adas.high.common;
import android.os.Handler;
import android.os.HandlerThread;
import android.os.Looper;
import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.Executor;
import java.util.concurrent.ThreadFactory;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicInteger;
public class HandlerThreadManager {
private volatile static HandlerThread sBackgroundHandlerThread;
private volatile static HandlerThread sIOHandlerThread;
private volatile static Handler sBackgroundHandler;
private volatile static Handler sMainHandler;
public static Handler getBackgroundHandler() {
if (sBackgroundHandler == null) {
sBackgroundHandler = new Handler(getBackgroundHandlerThread().getLooper());
}
return sBackgroundHandler;
}
public static HandlerThread getBackgroundHandlerThread() {
synchronized (HandlerThreadManager.class) {
if (sBackgroundHandlerThread == null) {
sBackgroundHandlerThread = new HandlerThread("autopilot_bgd_thread");
sBackgroundHandlerThread.start();
}
}
return sBackgroundHandlerThread;
}
private static HandlerThread getVideoHandlerThread() {
synchronized (HandlerThreadManager.class) {
if (sIOHandlerThread == null) {
sIOHandlerThread = new HandlerThread("autopilot_video_thread");
sIOHandlerThread.start();
}
}
return sIOHandlerThread;
}
public static Handler getMainHandler() {
if (sMainHandler == null) {
sMainHandler = new Handler(Looper.getMainLooper());
}
return sMainHandler;
}
public static final Executor EXECUTOR = new ThreadPoolExecutor(2, 5, 60L, TimeUnit.SECONDS, new ArrayBlockingQueue<Runnable>(30),
new ThreadFactory() {
private final AtomicInteger mCount = new AtomicInteger(1);
public Thread newThread(Runnable r) {
return new Thread(r, "autopilot-thread-pool" + mCount.getAndIncrement());
}
});
}

View File

@@ -22,7 +22,6 @@ public class ReportMessage extends MyAbstractMessageHandler {
if (adasListener != null) {
adasListener.onReportMessage(header, mogoReportMessage);
}
// CupidLogUtils.e("监控事件报告--->" + mogoReportMessage.toString());
}