Merge branch 'dev_robotaxi-d-app-module_270_220510_2.7.0' into dev_robotaxi-d-app-module_270_passenger

This commit is contained in:
yangyakun
2022-05-16 14:56:32 +08:00
110 changed files with 2866 additions and 1650 deletions

View File

@@ -51,7 +51,6 @@ dependencies {
kapt rootProject.ext.dependencies.aroutercompiler
implementation rootProject.ext.dependencies.mogochainbase
implementation rootProject.ext.dependencies.mogoami
implementation rootProject.ext.dependencies.mogoaicloudtelematic

View File

@@ -11,6 +11,10 @@ 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.chain.ChainConstant
import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_ALIAS_CODE_MULTI_CONNECT
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_AUTOPILOT
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_ADAS_IMPL
import com.mogo.eagle.core.data.trafficlight.TrafficLightResult
import com.mogo.eagle.core.data.trafficlight.toTrafficLightDetail
@@ -39,10 +43,13 @@ import com.mogo.telematic.server.netty.NettyTcpServer
import com.zhidao.support.adas.high.AdasManager
import com.zhidao.support.adas.high.AdasOptions
import com.zhidao.support.adas.high.bean.IPCUpgradeInfo
import com.zhidao.support.adas.high.chain.AdasChain.CHAIN_LINK_LOG_CONNECT_STATUS
import com.zhidao.support.adas.high.common.Constants
import com.zhidao.support.adas.high.common.Constants.IPC_CONNECTION_STATUS
import com.zhidao.support.adas.high.common.CupidLogUtils
import com.zhidao.support.adas.high.common.MogoReport
import com.zhjt.service.chain.ChainLog
import com.zhjt.service.chain.TracingConstants
import io.netty.channel.Channel
import mogo.telematics.pad.MessagePad
import java.util.concurrent.TimeUnit
@@ -95,23 +102,26 @@ class MoGoAutopilotProvider :
platNumberArray.size, platNumberArray
), channel
) {
CallerLogger.d("$M_ADAS_IMPL$TAG", "司机发送车牌号到乘客是否成功:${it.isSuccess}")
invokeNettyConnResult("司机发送车牌号到乘客是否成功:${it.isSuccess}")
}
} else {
CallerAutoPilotManager.getCarConfig()
}
}
else -> {}
else -> {
}
}
}
}
override fun onStartServer() {
ToastUtils.showShort("司机端服务启动成功!")
invokeNettyConnResult("司机端服务启动成功!")
}
override fun onStopServer() {
ToastUtils.showLong("司机端服务停止!")
invokeNettyConnResult("司机端服务停止!")
}
override fun onChannelConnect(channel: Channel?) {
@@ -240,13 +250,27 @@ class MoGoAutopilotProvider :
}
override fun startAutoPilot(controlParameters: AutopilotControlParameters) {
if (AdasManager.getInstance().ipcConnectionStatus == Constants.IPC_CONNECTION_STATUS.CONNECTED) {
AdasManager.getInstance().sendAutoPilotModeReq(1, 1, controlParameters.toRouteInfo())
if (AdasManager.getInstance().ipcConnectionStatus == IPC_CONNECTION_STATUS.CONNECTED) {
val invokeResult = AdasManager.getInstance().sendAutoPilotModeReq(1, 1, controlParameters.toRouteInfo())
invokeAutoPilotResult(if (invokeResult) "自动驾驶调用成功" else "自动驾驶调用失败, socket 或者 rawPack 可能为空")
} else {
invokeAutoPilotResult("车机与工控机链接失败,无法开启自动驾驶")
CallerLogger.e("$M_ADAS_IMPL$TAG", "车机与工控机链接失败,无法开启自动驾驶")
}
}
@ChainLog(
linkChainLog = CHAIN_LINK_LOG_WEB_SOCKET_AUTOPILOT,
linkCode = CHAIN_LINK_ADAS,
endpoint = TracingConstants.Endpoint.PAD,
nodeAliasCode = ChainConstant.CHAIN_ALIAS_CODE_EAGLE_START_AUTOPILOT_RESULT,
paramIndexes = [0],
clientPkFileName = "sn"
)
private fun invokeAutoPilotResult(status: String) {
CallerLogger.e("$M_ADAS_IMPL$TAG", status)
}
override fun sendTrafficLightData(trafficLightResult: TrafficLightResult) {
AdasManager.getInstance().sendTrafficLightData(
trafficLightResult.crossId,
@@ -449,49 +473,51 @@ class MoGoAutopilotProvider :
}
private fun handleMsgFromServer(msg: MogoProtocolMsg?, channel: Channel) {
try {
msg?.let {
when (it.protocolType) {
NORMAL_DATA -> AdasManager.getInstance().parseIPCData(it.body)
SYNC_MODE_STATUS -> {
FunctionBuildConfig.isDemoMode = when (it.body[0].toInt()) {
1 -> true
else -> false
}
setDemoMode(FunctionBuildConfig.isDemoMode)
msg?.let {
when (it.protocolType) {
NORMAL_DATA -> {
try {
AdasManager.getInstance().parseIPCData(it.body)
} catch (e: Exception) {
e.printStackTrace()
CallerLogger.e("$M_ADAS_IMPL$TAG", "乘客屏解析数据过程中出现异常:${e.message}")
}
REQ_CAR_NUMBER -> {
AppConfigInfo.plateNumber = String(msg.body)
}
SYNC_MODE_STATUS -> {
FunctionBuildConfig.isDemoMode = when (it.body[0].toInt()) {
1 -> true
else -> false
}
else -> {}
setDemoMode(FunctionBuildConfig.isDemoMode)
}
REQ_CAR_NUMBER -> {
AppConfigInfo.plateNumber = String(msg.body)
invokeNettyConnResult("司机屏发送给乘客屏车牌号为:${AppConfigInfo.plateNumber}")
}
else -> {
}
}
} catch (e: Exception) {
e.printStackTrace()
CallerLogger.e("$M_ADAS_IMPL$TAG", "乘客屏解析数据流程中出现异常:${e.message}")
}
}
private fun handleConnStatusWithServer(statusCode: Int, sign: String?) {
when (statusCode) {
ConnectState.STATUS_CONNECT_SUCCESS -> {
CallerLogger.d("$M_ADAS_IMPL$TAG", "乘客端连接司机端服务成功! sign is:${sign}")
ToastUtils.showShort("连接司机屏成功!")
invokeNettyConnResult("乘客屏连接司机屏成功司机屏SN为$sign")
// 连接成功后,乘客屏没拿到车牌号就像司机屏请求
if (AppConfigInfo.plateNumber.isNullOrEmpty()) {
var byteArray = byteArrayOf(0)
NSDNettyManager.getInstance().sendMogoProtocolMsgToServer(
MogoProtocolMsg(REQ_CAR_NUMBER, byteArray.size, byteArray)
) {
CallerLogger.d("$M_ADAS_IMPL$TAG", "请求车牌号数据发送是否成功:${it}")
invokeNettyConnResult("乘客屏请求车牌号数据发送是否成功:${it}")
}
}
}
else -> {
ToastUtils.showLong("和司机端连接异常!")
CallerLogger.d(
"$M_ADAS_IMPL$TAG",
"client statusCode is:${statusCode}"
)
invokeNettyConnResult("乘客屏和司机屏连接异常,状态码为:$statusCode")
}
}
}
@@ -499,5 +525,18 @@ class MoGoAutopilotProvider :
override fun onAutopilotCarConfig(carConfigResp: MessagePad.CarConfigResp) {
// 乘客屏才监听
AppConfigInfo.plateNumber = carConfigResp.plateNumber
invokeNettyConnResult("乘客屏车牌号:${carConfigResp.plateNumber}")
}
@ChainLog(
linkChainLog = CHAIN_LINK_LOG_CONNECT_STATUS,
linkCode = CHAIN_LINK_ADAS,
endpoint = TracingConstants.Endpoint.PAD,
nodeAliasCode = CHAIN_ALIAS_CODE_MULTI_CONNECT,
paramIndexes = [0],
clientPkFileName = "sn"
)
private fun invokeNettyConnResult(status: String) {
CallerLogger.d("$M_ADAS_IMPL$TAG", status)
}
}

View File

@@ -25,17 +25,14 @@ import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListener
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager.invokeAutopilotSNRequest
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotCarConfigListenerManager.invokeAutopilotCarConfigData
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotCarStatusListenerManager.invokeAutopilotCarStateData
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotIdentifyListenerManager
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotIdentifyListenerManager.invokeAutopilotIdentifyDataUpdate
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotRecordListenerManager.invokeAutopilotRecordResult
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotIdentifyListenerManager.invokeAutopilotWarnMessage
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.showAdUpgradeStatus
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager.showDockerRebootResult
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_ADAS_IMPL
import com.zhidao.support.adas.high.AdasManager
import com.zhidao.support.adas.high.OnAdasListener
import com.zhidao.support.adas.high.bean.IPCUpgradeStateInfo
@@ -228,7 +225,11 @@ class MoGoAdasListenerImpl : OnAdasListener {
header: MessagePad.Header?,
trafficLights: TrafficLightOuterClass.TrafficLights?
) {
if(trafficLights != null){
CallerAutopilotIdentifyListenerManager.invokeAutopilotPerceptionTrafficLight(
trafficLights
)
}
}
override fun onPredictionObstacleTrajectory(
@@ -327,23 +328,7 @@ class MoGoAdasListenerImpl : OnAdasListener {
}
override fun onUpgradeStateInfo(info: IPCUpgradeStateInfo) {
if (info != null) {
CallerLogger.d(
"$M_ADAS_IMPL$TAG", "onUpgradeStateInfo " +
" upgrade mode=" + info.upgradeMode +
" download status=" + info.downloadStatus +
" download progress current=" + info.progress.current +
" download progress total=" + info.progress.total +
" download version=" + info.images +
" upgrade status=" + info.upgradeStatus
)
showAdUpgradeStatus(
info.upgradeMode, info.downloadStatus, info.progress.current,
info.progress.total, info.images, info.upgradeStatus
)
} else {
CallerLogger.w("$M_ADAS_IMPL$TAG", "onUpgradeStateInfo : upgrade state info is null")
}
}
// override fun onSSHResult(info: com.zhidao.adas.client.ssh.SSHResult?) {

View File

@@ -12,6 +12,7 @@ import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_
import com.mogo.eagle.core.utilcode.util.ToastUtils
import com.zhidao.support.adas.high.AdasManager
import com.zhidao.support.adas.high.OnAdasConnectStatusListener
import com.zhidao.support.adas.high.bean.VersionCompatibility
import com.zhidao.support.adas.high.common.Constants
import io.reactivex.Flowable
import io.reactivex.android.schedulers.AndroidSchedulers
@@ -78,6 +79,10 @@ class MoGoAdasMsgConnectStatusListenerImpl : OnAdasConnectStatusListener,
CallerAutoPilotStatusListenerManager.invokeAutoPilotStatus()
}
override fun onCompatibility(versionCompatibility: VersionCompatibility?) {
// 与所连接工控机版本兼容性检查通知
}
/**
* 工控机获取SN
*/

View File

@@ -1,7 +1,6 @@
package com.mogo.eagle.core.function.bindingcar;
import android.content.Context;
import android.util.Log;
import com.alibaba.android.arouter.facade.annotation.Route;
import com.mogo.eagle.core.data.config.FunctionBuildConfig;
@@ -10,6 +9,7 @@ import com.mogo.eagle.core.data.constants.MogoServicePaths;
import com.mogo.eagle.core.function.api.bindingcar.BindingcarCallBack;
import com.mogo.eagle.core.function.api.bindingcar.IMoGoBindingcarProvider;
import com.mogo.eagle.core.function.bindingcar.network.BindingcarNetWorkManager;
import com.mogo.eagle.core.function.ipcupgrade.IPCUpgradeManager;
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils;
import org.jetbrains.annotations.NotNull;
@@ -34,12 +34,13 @@ public class BindingcarProvider implements IMoGoBindingcarProvider {
@Override
public void onDestroy() {
IPCUpgradeManager.Companion.getINSTANCE().destroy();
}
@Override
public void init(Context context) {
mContext = context;
IPCUpgradeManager.Companion.getINSTANCE().initServer(context);
}
/**

View File

@@ -0,0 +1,64 @@
package com.mogo.eagle.core.function.ipcupgrade
import android.content.Context
import android.util.Log
import com.mogo.aicloud.services.socket.IMogoOnMessageListener
import com.mogo.aicloud.services.socket.MogoAiCloudSocketManager
import com.mogo.eagle.core.data.autopilot.AutopilotStatusInfo
import com.mogo.eagle.core.data.bindingcar.IPCUpgradeStateInfo
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager
/**
* @author XuXinChao
* @description 工控机镜像版本升级管理
* @since: 2022/5/12
*/
class IPCUpgradeManager: IMogoOnMessageListener<IPCUpgradeStateInfo> ,
IMoGoAutopilotStatusListener {
companion object{
const val TAG ="IPCUpgradeManager"
const val IPC_UPGRADE_MSG_TYPE = 50000
val INSTANCE: IPCUpgradeManager by lazy(mode = LazyThreadSafetyMode.SYNCHRONIZED){
IPCUpgradeManager()
}
}
private var mContext: Context? = null
fun initServer(context: Context){
mContext = context
//添加长链接监听
MogoAiCloudSocketManager.getInstance(context)
.registerOnMessageListener(IPC_UPGRADE_MSG_TYPE, this)
// 添加 ADAS状态 监听
CallerAutoPilotStatusListenerManager.addListener(TAG, this)
}
override fun target(): Class<IPCUpgradeStateInfo> {
return IPCUpgradeStateInfo::class.java
}
override fun onMsgReceived(obj: IPCUpgradeStateInfo?) {
}
/**
* 自动驾驶状态信息
* @param autoPilotStatusInfo 状态信息
*/
override fun onAutopilotStatusResponse(autoPilotStatusInfo: AutopilotStatusInfo) {
}
fun destroy(){
//注销长链接监听
MogoAiCloudSocketManager.getInstance(mContext)
.unregisterLifecycleListener(IPC_UPGRADE_MSG_TYPE)
// 移除 ADAS状态 监听
CallerAutoPilotStatusListenerManager.removeListener(TAG)
mContext = null
}
}

View File

@@ -11,6 +11,7 @@ import com.mogo.eagle.core.function.check.net.CheckNetWork.checkNetWork
import com.mogo.eagle.core.function.check.net.CheckResultData
import com.mogo.eagle.core.function.check.view.CheckActivity
import com.mogo.eagle.core.function.check.view.CheckDialog
import com.mogo.eagle.core.function.report.IPCReportManager
import com.mogo.eagle.core.utilcode.util.*
import com.mogo.module.common.MogoApisHandler
import com.mogo.service.statusmanager.IMogoStatusChangedListener
@@ -31,6 +32,10 @@ class VehicleMonitoringManager : ICheckProvider, IMogoStatusChangedListener {
private val mListeners: ConcurrentHashMap<String, IMogoCheckListener> = ConcurrentHashMap()
private var hasTipShow = false //是否已经弹框提示
var dialog: CheckDialog? = null
override val functionName: String
get() = "VehicleMonitoringManager"
override fun init(context: Context) {
mContext = context
MogoApisHandler.getInstance().apis.statusManagerApi.registerStatusChangedListener(
@@ -38,6 +43,8 @@ class VehicleMonitoringManager : ICheckProvider, IMogoStatusChangedListener {
StatusDescriptor.MAIN_PAGE_RESUME,
this
)
//开启工控机监控节点上报服务
IPCReportManager.INSTANCE.initServer()
}
override fun registerVehicleMonitoringListener(module: String, listener: IMogoCheckListener) {
@@ -113,4 +120,10 @@ class VehicleMonitoringManager : ICheckProvider, IMogoStatusChangedListener {
}
}
}
override fun onDestroy() {
//停止工控机监控节点上报服务
IPCReportManager.INSTANCE.destroy()
}
}

View File

@@ -0,0 +1,58 @@
package com.mogo.eagle.core.function.report
import com.mogo.eagle.core.data.config.FunctionBuildConfig
import com.mogo.eagle.core.data.report.ReportEntity
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager
import com.mogo.eagle.core.utilcode.util.ThreadUtils
import com.mogo.eagle.core.utilcode.util.TimeUtils
import mogo_msg.MogoReportMsg
/**
* @author XuXinChao
* @description 工控机监控节点信息上报管理
* @since: 2022/5/12
*/
class IPCReportManager : IMoGoAutopilotStatusListener {
private var ipcReportList = arrayListOf<ReportEntity>()
companion object{
const val TAG ="IPCReportManager"
val INSTANCE: IPCReportManager by lazy(mode = LazyThreadSafetyMode.SYNCHRONIZED) {
IPCReportManager()
}
}
fun initServer(){
// 添加 ADAS状态 监听
CallerAutoPilotStatusListenerManager.addListener(TAG, this)
}
/**
*工控机监控节点上报
*/
override fun onAutopilotGuardian(guardianInfo: MogoReportMsg.MogoReportMessage?) {
guardianInfo?.let{
if(it.level=="error"){
if(ipcReportList.size>20){
ipcReportList.removeLast()
}
ipcReportList.add(0,
ReportEntity(TimeUtils.millis2String(System.currentTimeMillis()),
it.src,it.level,it.msg,it.code,it.resultList,it.actionsList))
//当前不处于美化模式时,展示监控节点上报
if(!FunctionBuildConfig.isDemoMode){
CallerHmiManager.showIPCReportWindow(ipcReportList)
}
}
}
}
fun destroy(){
// 移除 ADAS状态 监听
CallerAutoPilotStatusListenerManager.removeListener(TAG)
}
}

View File

@@ -72,7 +72,6 @@ dependencies {
implementation rootProject.ext.dependencies.arouter
kapt rootProject.ext.dependencies.aroutercompiler
implementation rootProject.ext.dependencies.mogologlib
implementation rootProject.ext.dependencies.mogochainbase
implementation rootProject.ext.dependencies.androidx_datastore
implementation rootProject.ext.dependencies.androidxroomruntime

View File

@@ -4,6 +4,7 @@ import android.annotation.SuppressLint
import android.content.Context
import android.os.Handler
import android.os.Message
import com.mogo.aicloud.services.socket.IMogoOnMessageListener
import com.mogo.aicloud.services.socket.MogoAiCloudSocketManager
import com.mogo.cloud.passport.MoGoAiCloudClient
import com.mogo.cloud.passport.MoGoAiCloudClientConfig
@@ -11,8 +12,10 @@ import com.mogo.commons.AbsMogoApplication
import com.mogo.commons.debug.DebugConfig
import com.mogo.eagle.core.data.app.AppConfigInfo
import com.mogo.eagle.core.data.constants.MoGoConfig
import com.mogo.eagle.core.function.api.map.deva.IMoGoMapDevaProvider
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsListenerManager
import com.mogo.eagle.core.function.call.map.CallerMapDevaListenerManager
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
import com.mogo.eagle.core.utilcode.mogo.logger.LogLevel
import com.mogo.eagle.core.utilcode.mogo.logger.Logger
@@ -20,7 +23,6 @@ import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_
import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr
import com.mogo.eagle.core.utilcode.mogo.toast.TipToast
import com.mogo.eagle.core.utilcode.util.ThreadUtils
import com.mogo.aicloud.services.socket.IMogoOnMessageListener
import com.zhidao.loglib.bean.RemoteLogPushContent
import com.zhidao.loglib.call.LogInfoManagerFactory
import com.zhidao.loglib.core.ILogListener
@@ -30,10 +32,11 @@ import com.zhjt.mogo_core_function_devatools.logcatch.MogoLogCatchConst.Companio
import com.zhjt.mogo_core_function_devatools.logcatch.MogoLogCatchConst.Companion.LOG_PUSH_TYPE
import com.zhjt.mogo_core_function_devatools.logcatch.MogoLogCatchConst.Companion.START_CATCH_LOG
import com.zhjt.mogo_core_function_devatools.logcatch.MogoLogCatchConst.Companion.STOP_CATCH_LOG
import java.io.File
@SuppressLint("StaticFieldLeak")
object MogoLogCatchManager : IMogoOnMessageListener<RemoteLogPushContent>, Handler.Callback,
ILogListener {
ILogListener, IMoGoMapDevaProvider {
private const val TAG = "MogoLogCatchManager"
private const val MSG_TRY_CLOSE_LOG = 1001
@@ -50,6 +53,7 @@ object MogoLogCatchManager : IMogoOnMessageListener<RemoteLogPushContent>, Handl
mContext = context
MogoAiCloudSocketManager.getInstance(AbsMogoApplication.getApp().applicationContext)
.registerOnMessageListener(LOG_PUSH_TYPE, this)
CallerMapDevaListenerManager.addListener(TAG, this)
manualContent.pkgName = context.packageName
logCheck(context)
}
@@ -107,7 +111,7 @@ object MogoLogCatchManager : IMogoOnMessageListener<RemoteLogPushContent>, Handl
}
override fun handleMessage(msg: Message): Boolean {
when(msg.what){
when (msg.what) {
MSG_TRY_CLOSE_LOG -> {
CallerDevaToolsListenerManager.invokeDevaToolsLogCatchClose()
closeLoggerLevel()
@@ -225,10 +229,20 @@ object MogoLogCatchManager : IMogoOnMessageListener<RemoteLogPushContent>, Handl
}
}
override fun uploadFile(filePath: String) {
val file = File(filePath)
if (file.isFile) {
CallerLogger.d("$M_DEVA$TAG", "uploadFile path : $filePath")
LogInfoManagerFactory.handleSingleUploadFile(filePath)
}else{
CallerLogger.d("$M_DEVA$TAG", "file absPath : ${file.absolutePath}")
}
}
fun onDestroy() {
MogoAiCloudSocketManager.getInstance(AbsMogoApplication.getApp().applicationContext)
.unregisterLifecycleListener(LOG_PUSH_TYPE)
CallerMapDevaListenerManager.removeListener(this)
if (handler.hasMessages(MSG_TRY_CLOSE_LOG)) {
handler.removeMessages(MSG_TRY_CLOSE_LOG)
}

View File

@@ -4,6 +4,7 @@ import android.content.Context
import com.mogo.cloud.passport.MoGoAiCloudClientConfig
import com.mogo.eagle.core.data.deva.chain.ChainConstant
import com.mogo.eagle.core.data.deva.chain.ChainLogParam
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsListenerManager
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_DEVA
import com.mogo.eagle.core.utilcode.util.DeviceUtils
@@ -33,15 +34,15 @@ class TraceManager {
// Trace过程中进行日志抓取对日志进行配置
fwBuildMap[ChainConstant.CHAIN_LINK_LOG_CONNECT_STATUS] =
FwBuild(true, pkgName + ChainConstant.CHAIN_LINK_LOG_ADAS_INIT)
FwBuild(true, -1,pkgName + ChainConstant.CHAIN_LINK_LOG_ADAS_INIT)
fwBuildMap[ChainConstant.CHAIN_LINK_LOG_WEB_SOCKET_AUTOPILOT] =
FwBuild(true, pkgName + ChainConstant.CHAIN_LINK_LOG_ADAS_AUTO)
FwBuild(true, -1,pkgName + ChainConstant.CHAIN_LINK_LOG_ADAS_AUTO)
fwBuildMap[ChainConstant.CHAIN_LINK_LOG_WEB_SOCKET_DATA_TRACKED] =
FwBuild(false, pkgName + ChainConstant.CHAIN_LINK_LOG_ADAS_DATA_TRACK)
FwBuild(false, 2,pkgName + ChainConstant.CHAIN_LINK_LOG_ADAS_DATA_TRACK)
fwBuildMap[ChainConstant.CHAIN_LINK_LOG_WEB_SOCKET_TRAJECTORY] =
FwBuild(false, pkgName + ChainConstant.CHAIN_LINK_LOG_ADAS_TRAJECTORY)
FwBuild(false, 30,pkgName + ChainConstant.CHAIN_LINK_LOG_ADAS_TRAJECTORY)
fwBuildMap[ChainConstant.CHAIN_LINK_LOG_WEB_SOCKET_VEHICLE] =
FwBuild(false, pkgName + ChainConstant.CHAIN_LINK_LOG_ADAS_VEHICLE)
FwBuild(false, 30,pkgName + ChainConstant.CHAIN_LINK_LOG_ADAS_VEHICLE)
traceInfoCache[ChainConstant.CHAIN_LINK_LOG_CONNECT_STATUS] =
ChainLogParam(true, "ADAS连接状态")
@@ -56,6 +57,14 @@ class TraceManager {
FileWriteManager.getInstance()
.init(context, MoGoAiCloudClientConfig.getInstance().sn, pkgName, fwBuildMap)
FileWriteManager.getInstance().registerListener { type ->
val param = traceInfoCache[type]
param?.let {
it.record = false
traceInfoCache[type] = it
}
CallerDevaToolsListenerManager.invokeDevaToolsFwThreadClose()
}
}
fun setTraceLogEnable(enable:Boolean){

View File

@@ -73,8 +73,7 @@ dependencies {
implementation rootProject.ext.dependencies.mogoami
implementation rootProject.ext.dependencies.mogochainbase
implementation rootProject.ext.dependencies.android_start_up
if (Boolean.valueOf(USE_MAVEN_PACKAGE)) {
api rootProject.ext.dependencies.mogoaicloudservicesdk
api rootProject.ext.dependencies.mogocommons

View File

@@ -89,8 +89,10 @@ internal class WarningFloatWindowHelper(
// 将浮窗布局文件添加到父容器frameLayout中并返回该浮窗文件
val floatingView = config.layoutView?.also {
try {
val parent = (it.parent as ViewGroup)
parent.removeAllViews()
if (it.parent != null) {
val parent = (it.parent as ViewGroup)
parent.removeAllViews()
}
} catch (e: Exception) {
e.printStackTrace()
}

View File

@@ -11,9 +11,9 @@ import android.view.WindowManager.LayoutParams
import android.view.animation.*
import androidx.lifecycle.lifecycleScope
import com.alibaba.android.arouter.facade.annotation.Route
import com.mogo.commons.AbsMogoApplication
import com.mogo.commons.mvp.MvpFragment
import com.mogo.commons.voice.AIAssist
import com.mogo.eagle.core.data.autopilot.AdUpgradeStateHelper
import com.mogo.eagle.core.data.camera.CameraEntity
import com.mogo.eagle.core.data.config.FunctionBuildConfig
import com.mogo.eagle.core.data.config.HmiBuildConfig
@@ -47,6 +47,7 @@ import com.mogo.eagle.core.function.hmi.ui.camera.CameraListView
import com.mogo.eagle.core.function.hmi.ui.notice.NoticeBannerView
import com.mogo.eagle.core.function.hmi.ui.notice.NoticeNormalBannerView
import com.mogo.eagle.core.function.hmi.ui.setting.DebugSettingView
import com.mogo.eagle.core.function.hmi.ui.setting.IPCReportWindow
import com.mogo.eagle.core.function.hmi.ui.setting.ReportListFloatWindow
import com.mogo.eagle.core.function.hmi.ui.tools.AutoPilotAndCheckView
import com.mogo.eagle.core.function.hmi.ui.widget.V2XNotificationView
@@ -62,6 +63,7 @@ import kotlinx.coroutines.*
import mogo_msg.MogoReportMsg
import record_cache.RecordPanelOuterClass
import java.util.*
import kotlin.collections.ArrayList
/**
@@ -112,6 +114,8 @@ class MoGoHmiFragment : MvpFragment<MoGoHmiContract.View?, HmiPresenter?>(),
private var reportList = arrayListOf<ReportEntity>()
//工控机上报列表悬浮窗
private var reportListFloatWindow: ReportListFloatWindow?=null
private var ipcReportWindow: IPCReportWindow?=null
override fun vipIdentification(visible: Boolean) {
ThreadUtils.runOnUiThread {
@@ -210,13 +214,28 @@ class MoGoHmiFragment : MvpFragment<MoGoHmiContract.View?, HmiPresenter?>(),
ToastUtils.showShort("重启成功")
} else {
//重启失败
msg?.let {
msg.let {
ToastUtils.showShort(it)
}
}
}
}
/**
* 展示工控机监控上报数据
* @param reportList 上报数据列表
*/
override fun showIPCReportWindow(reportList: ArrayList<ReportEntity>) {
ThreadUtils.runOnUiThread{
if(ipcReportWindow==null){
ipcReportWindow= activity?.let { IPCReportWindow(it) }
ipcReportWindow?.showFloatWindow()
AIAssist.getInstance(AbsMogoApplication.getApp()).speakTTSVoice("")
}
ipcReportWindow?.refreshData(reportList)
}
}
/**
* 设置 V2X 通知 代理View
*/
@@ -950,60 +969,6 @@ class MoGoHmiFragment : MvpFragment<MoGoHmiContract.View?, HmiPresenter?>(),
HmiBuildConfig.isShowSnBindingView = isOpen
}
/**
* 展示工控机下载、升级状态信息
* @param upgradeMode 升级模式(提示升级、静默升级)
* @param downloadStatus 下载状态
* @param currentProgress 当前已经下载包体大小
* @param totalProgress 下载包体总大小
* @param downloadVersion 下载版本
* @param upgradeStatus 升级状态
*/
override fun showAdUpgradeStatus(
upgradeMode: Int,
downloadStatus: Int,
currentProgress: Int,
totalProgress: Int,
downloadVersion: String,
upgradeStatus: Int
) {
ThreadUtils.runOnUiThread {
val tipsView = upgradeTipsView?.invoke()
//如果工控机处于“下载中”、“可升级(下载完成)”、“升级中”、“升级失败”状态时,工具箱入口显示红色角标
if (AdUpgradeStateHelper.showUpgradeTips(downloadStatus, upgradeStatus)) {
if (HmiBuildConfig.isShowUpgradeTipsView) {
viewUpgradeTips?.visibility = View.VISIBLE
} else {
tipsView?.let {
it.visibility = View.VISIBLE
}
}
} else {
viewUpgradeTips?.visibility = View.GONE
tipsView?.let {
it.visibility = View.GONE
}
}
//将状态同步到工具箱
toolsView?.showAdUpgradeStatus(
upgradeMode,
downloadStatus,
currentProgress,
totalProgress,
downloadVersion,
upgradeStatus
)
//将状态同步到调试窗
mDebugSettingView?.setAdUpgradeInfo(
upgradeMode,
downloadStatus,
currentProgress,
totalProgress,
downloadVersion,
upgradeStatus)
}
}
/**
* 工控机监控节点上报

View File

@@ -48,8 +48,6 @@ import com.mogo.eagle.core.function.call.telematic.CallerTelematicManager
import com.mogo.eagle.core.function.hmi.R
import com.mogo.eagle.core.function.hmi.ui.logcatch.ILogViewListener
import com.mogo.eagle.core.function.hmi.ui.logcatch.LogInfoView
import com.mogo.eagle.core.function.hmi.ui.tools.AdUpgradeDialog
import com.mogo.eagle.core.function.hmi.ui.tools.DockerRebootDialog
import com.mogo.eagle.core.function.hmi.ui.upgrade.UpgradeListAdapter
import com.mogo.eagle.core.utilcode.kotlin.onClick
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
@@ -83,8 +81,8 @@ class DebugSettingView @JvmOverloads constructor(
) : ConstraintLayout(context, attrs, defStyleAttr), IMoGoObuStatusListener,
IMoGoAutopilotStatusListener, IMoGoAutopilotCarStateListener,
IMoGoMapLocationListener, IMoGoAutopilotIdentifyListener,
IMoGoAutopilotPlanningListener, IMoGoAutopilotCarConfigListener
,IMoGoAutopilotVehicleStateListener{
IMoGoAutopilotPlanningListener, IMoGoAutopilotCarConfigListener,
IMoGoAutopilotVehicleStateListener {
private val TAG = "DebugSettingView"
@@ -94,7 +92,7 @@ class DebugSettingView @JvmOverloads constructor(
private var mAutoPilotStatusInfo: AutopilotStatusInfo? = null
private var mGnssInfo: MessagePad.GnssInfo? = null
private var accelerationFloatWindow: AccelerationFloatWindow?=null
private var accelerationFloatWindow: AccelerationFloatWindow? = null
private var accelerationList = arrayListOf<AccelerationEntity>()
private var accelerationIsShow: Boolean = false //实时加速度面板是否展示
private var accelerationThresholdNum: Double = 0.0
@@ -114,19 +112,6 @@ class DebugSettingView @JvmOverloads constructor(
//日志过滤标签集合
private val sceneMap = mutableMapOf<String, SceneModule>()
private var dockerRebootDialog: DockerRebootDialog? = null //docker重启对话框
private var adUpgradeDialog: AdUpgradeDialog? = null //工控机升级对话框
private var upgradeMode: Int = -1 //升级模式
private var downloadStatus: Int = -1 //下载状态
private var currentProgress: Int = -1 //当前已下载包体大小
private var previousProgress: Int = -1 //前一秒的下载进度,用于计算下载剩余时间
private var totalProgress: Int = -1 //包体总大小
private var downloadVersion: String? = null //工控机docker版本
private var upgradeStatus: Int = -1 //升级状态
//ADAS连接状态
private var adasConnectStatus: Boolean = false
//OBU连接状态
private var obuConnectStatus: Boolean = false
@@ -134,9 +119,9 @@ class DebugSettingView @JvmOverloads constructor(
private var onlineSelected: Boolean = true
private var qaSelected: Boolean = true
private var upgradeListAdapter: UpgradeListAdapter?=null
private var upgradeListAdapter: UpgradeListAdapter? = null
private val upgradeVersionList by lazy{
private val upgradeVersionList by lazy {
ArrayList<UpgradeVersionEntity>()
}
@@ -182,7 +167,7 @@ class DebugSettingView @JvmOverloads constructor(
// 添加 工控机基础信息回调 监听
CallerAutopilotCarConfigListenerManager.addListener(TAG, this)
//添加 车辆底盘数据回调 监听
CallerAutopilotVehicleStateListenerManager.addListener(TAG,this)
CallerAutopilotVehicleStateListenerManager.addListener(TAG, this)
if (logInfoView != null) {
logInfoView!!.onEnterForeground()
}
@@ -292,11 +277,11 @@ class DebugSettingView @JvmOverloads constructor(
* 鹰眼参数配置
*/
tbEagleEyeController.setOnCheckedChangeListener { buttonView, isChecked ->
if(isChecked){
if (isChecked) {
buttonView.setCompoundDrawables(null, null, iconDown, null)
//展示参数配置
eagleEyeControllerLayout.visibility = View.VISIBLE
}else{
} else {
buttonView.setCompoundDrawables(null, null, iconRight, null)
//隐藏参数配置
eagleEyeControllerLayout.visibility = View.GONE
@@ -338,7 +323,7 @@ class DebugSettingView @JvmOverloads constructor(
* 车辆状态控制中心
*/
tbVehicleStateController.setOnCheckedChangeListener { buttonView, isChecked ->
if(isChecked){
if (isChecked) {
buttonView.setCompoundDrawables(null, null, iconDown, null)
//展示车辆状态中心
vehicleStateLayout.visibility = View.VISIBLE
@@ -398,7 +383,7 @@ class DebugSettingView @JvmOverloads constructor(
* 应用包管理中心
*/
btnApkCenter.setOnCheckedChangeListener { buttonView, isChecked ->
if(isChecked){
if (isChecked) {
buttonView.setCompoundDrawables(null, null, iconDown, null)
//展示应用包管理中心
apkCenterLayout.visibility = View.VISIBLE
@@ -598,7 +583,7 @@ class DebugSettingView @JvmOverloads constructor(
}
//初始化切换自车按钮文本Bus版本默认显示切换自车为出租车
if(AppIdentityModeUtils.isBus(FunctionBuildConfig.appIdentityMode)){
if (AppIdentityModeUtils.isBus(FunctionBuildConfig.appIdentityMode)) {
tbChangeCurrentCarIcon.isChecked = true
}
@@ -615,27 +600,28 @@ class DebugSettingView @JvmOverloads constructor(
/**
* 设置鹰眼本地参数配置监听
*/
private fun setEagleEyeConfigListener(){
private fun setEagleEyeConfigListener() {
//初始化刹车加速度阈值信息
val brakeThreshold = SharedPrefsMgr.getInstance(context)
.getFloat(MoGoConfig.BRAKE_ACCELERATION_THRESHOLD,-2.5F)
.getFloat(MoGoConfig.BRAKE_ACCELERATION_THRESHOLD, -2.5F)
etInputBrakeThreshold.setText(brakeThreshold.toString())
etInputBrakeThreshold.text?.let { etInputBrakeThreshold.setSelection(brakeThreshold.toString().length) }
//设置刹车加速度阈值信息
btnBrakeThreshold.setOnClickListener {
val thresholdStr = etInputBrakeThreshold.text.toString()
if(thresholdStr.isEmpty()){
if (thresholdStr.isEmpty()) {
ToastUtils.showShort("请输入正确的判定刹车加速度阈值")
}else{
try{
} else {
try {
val thresholdStrFloat = thresholdStr.toFloat()
if(thresholdStrFloat<0){
SharedPrefsMgr.getInstance(context).putFloat(MoGoConfig.BRAKE_ACCELERATION_THRESHOLD,thresholdStrFloat)
if (thresholdStrFloat < 0) {
SharedPrefsMgr.getInstance(context)
.putFloat(MoGoConfig.BRAKE_ACCELERATION_THRESHOLD, thresholdStrFloat)
ToastUtils.showShort("刹车阈值设置成功")
}else{
} else {
ToastUtils.showShort("刹车阈值加速度值应小于0")
}
}catch (e: Exception){
} catch (e: Exception) {
ToastUtils.showShort("判定刹车加速度阈值格式设置不正确")
}
}
@@ -677,41 +663,6 @@ class DebugSettingView @JvmOverloads constructor(
CallerAutoPilotManager.disconnectIpc()
}
updateSpeedSettingViews()
/**
* 设置最大速度
*/
btnSetAutopilotSpeed.onClick {
if (AppConfigInfo.isConnectAutopilot) {
val speedStr = etInputSpeed.text?.toString()
try {
if (speedStr.isNullOrEmpty()) {
ToastUtils.showShort("请输入最大车速")
}
val speed = speedStr?.toInt()
if (speed != null && speed > 0 && speed < 60) {
// 设置自动驾驶速度
val isSuccess = CallerAutoPilotManager.setAutoPilotSpeed(speed)
when {
isSuccess -> {
ToastUtils.showShort("车速设置成功,立即生效")
}
else -> {
ToastUtils.showShort("设置车速失败,请启动域控制器")
}
}
} else {
ToastUtils.showShort("最大车速应大于0且小于60")
}
} catch (e: Exception) {
ToastUtils.showShort("车速设置失败,请正确设置车速")
}
} else {
ToastUtils.showShort("设置车速失败,请启动域控制器")
}
}
/**
* 录制Bag包
*/
@@ -732,151 +683,6 @@ class DebugSettingView @JvmOverloads constructor(
}
}
/**
* 工控机升级
*/
btnSystemUpgrade.onClick {
if (AppConfigInfo.isConnectAutopilot) {
Logger.i(
TAG,
"upgradeMode=" + upgradeMode + " downloadStatus=" + downloadStatus + " upgradeStatus=" + upgradeStatus
)
if (AdUpgradeStateHelper.isDownloading(downloadStatus)) {
//点击Toast提示下载剩余时间
ToastUtils.showShort(
"预计" + AdUpgradeStateHelper.getRemainingTime(
totalProgress,
previousProgress,
currentProgress
) + "下载完成"
)
} else if (AdUpgradeStateHelper.getUpgradeStatus()) {
//工控机状态为“升级中”
ToastUtils.showShort("新版本升级中预计5分钟升级完成")
} else if (AdUpgradeStateHelper.isUpgradeFailed(upgradeStatus)) {
//如果升级失败则Toast提示升级失败请联系运维人员
ToastUtils.showShort("升级失败,请联系运维人员")
} else if (AdUpgradeStateHelper.isHintUpgradeMode(upgradeMode) && AdUpgradeStateHelper.isDownloadFinish(
downloadStatus,
upgradeStatus
)
) {
//如果升级模式为“提示升级”,并且下载状态为已经下载完成,点击弹出升级确认弹窗
if (adUpgradeDialog == null) {
adUpgradeDialog = AdUpgradeDialog(context)
adUpgradeDialog?.setClickListener(object : AdUpgradeDialog.ClickListener {
override fun confirm() {
if (mAutoPilotStatusInfo?.state == 2) {
//当前处于自动驾驶状态不可进行升级Toast提示
ToastUtils.showShort("升级前请先退出自动驾驶模式")
} else {
//确认升级
Logger.i(TAG, "upgrade confirm")
//设置当前状态为“升级中”
AdUpgradeStateHelper.setUpgradeStatus(true)
CallerAutoPilotManager.setIPCUpgradeAffirm()
}
}
override fun cancel() {
//取消升级
Logger.i(TAG, "upgrade cancel")
//取消升级命令不下发
// CallerAutoPilotManager.setIPCUpgradeCancel()
}
})
}
adUpgradeDialog?.showUpgradeDialog()
} else {
ToastUtils.showShort("当前工控机处于最新版本状态,不可升级")
}
} else {
ToastUtils.showShort("域控制器未连接")
}
}
/**
* 重启系统
*/
btnSystemRestart.onClick {
if (AppConfigInfo.isConnectAutopilot) {
if (dockerRebootDialog == null) {
dockerRebootDialog = DockerRebootDialog(context)
dockerRebootDialog?.setClickListener(object : DockerRebootDialog.ClickListener {
override fun confirm() {
if (mAutoPilotStatusInfo?.state == 2) {
//当前处于自动驾驶状态不可进行重启Toast提示
ToastUtils.showShort("请先退出自动驾驶状态")
} else if (AdUpgradeStateHelper.showCannotReboot(
downloadStatus,
upgradeStatus
)
) {
//当工控机处于下载或者升级状态,需要先进行升级
ToastUtils.showShort("请先完成新自动驾驶系统的下载/升级")
} else {
//确认重启
Logger.i(TAG, "reboot confirm")
CallerAutoPilotManager.setIPCReboot()
}
}
override fun cancel() {
//取消重启
Logger.i(TAG, "reboot cancel")
}
})
}
dockerRebootDialog?.showUpgradeDialog()
} else {
ToastUtils.showShort("域控制器未连接")
}
}
}
/**
* Bus不可设置自动驾驶速度而Taxi可以
*/
private fun updateSpeedSettingViews() {
when {
AppIdentityModeUtils.isBus(FunctionBuildConfig.appIdentityMode) -> {
btnSetAutopilotSpeed.visibility = View.GONE
llSpeedLayout.visibility = View.GONE
}
else -> {
btnSetAutopilotSpeed.visibility = View.VISIBLE
llSpeedLayout.visibility = View.VISIBLE
}
}
}
/**
* 设置工控机下载、升级状态信息
* @param upgradeMode 升级模式(提示升级、静默升级)
* @param downloadStatus 下载状态
* @param currentProgress 当前已经下载包体大小
* @param totalProgress 下载包体总大小
* @param downloadVersion 下载版本
* @param upgradeStatus 升级状态
*/
fun setAdUpgradeInfo(
upgradeMode: Int, downloadStatus: Int, currentProgress: Int, totalProgress: Int,
downloadVersion: String, upgradeStatus: Int
) {
this.upgradeMode = upgradeMode
this.downloadStatus = downloadStatus
this.previousProgress = this.currentProgress
this.currentProgress = currentProgress
this.totalProgress = totalProgress
this.downloadVersion = downloadVersion
this.upgradeStatus = upgradeStatus
}
/**
@@ -976,13 +782,13 @@ class DebugSettingView @JvmOverloads constructor(
* 实时加速度面板控制
*/
tbOpenAcceleration.setOnCheckedChangeListener { _, isChecked ->
if(isChecked){
if (isChecked) {
//打开实时加速度面板
accelerationFloatWindow = context?.let { AccelerationFloatWindow(it as Activity) }
accelerationFloatWindow?.showFloatWindow()
etThreshold.visibility = View.VISIBLE
btnThresholdDefine.visibility = View.VISIBLE
}else{
} else {
//关闭实时加速度面板
accelerationFloatWindow?.hideFloatWindow()
etThreshold.visibility = View.GONE
@@ -992,9 +798,9 @@ class DebugSettingView @JvmOverloads constructor(
}
btnThresholdDefine.setOnClickListener {
try{
try {
accelerationThresholdNum = etThreshold.text.toString().toDouble()
}catch(e:java.lang.Exception){
} catch (e: java.lang.Exception) {
ToastUtils.showShort("请输入正确的阈值")
}
}
@@ -1198,6 +1004,10 @@ class DebugSettingView @JvmOverloads constructor(
}
}
override fun fwThreadClose() {
refreshTraceInfo()
}
override fun moduleLogChanged(moduleTag: MutableMap<String, SceneModule>) {
//模块日志 tag 发生变化,需要更新对应 UI
setLogCheckedChangeListener()
@@ -1207,12 +1017,16 @@ class DebugSettingView @JvmOverloads constructor(
//版本信息更新
urls?.let {
upgradeVersionList.clear()
it.iterator().forEach {map ->
val name = if(map.key.contains("{")) map.key.replace("{","") else map.key
val url = if(map.value.contains("}")) map.value.replace("}","") else map.value
upgradeVersionList.add(UpgradeVersionEntity(name.trim(),url))
it.iterator().forEach { map ->
val name =
if (map.key.contains("{")) map.key.replace("{", "") else map.key
val url = if (map.value.contains("}")) map.value.replace(
"}",
""
) else map.value
upgradeVersionList.add(UpgradeVersionEntity(name.trim(), url))
}
upgradeVersionList.sortByDescending { upgradeVersionEntity ->upgradeVersionEntity.name }
upgradeVersionList.sortByDescending { upgradeVersionEntity -> upgradeVersionEntity.name }
upgradeListAdapter?.setDada(dataFilter(upgradeVersionList))
upgradeListAdapter?.notifyDataSetChanged()
}
@@ -1242,23 +1056,8 @@ class DebugSettingView @JvmOverloads constructor(
}
}
val traceInfoMap = CallerDevaToolsManager.getTraceInfo()
val autopilot = traceInfoMap[ChainConstant.CHAIN_LINK_LOG_WEB_SOCKET_AUTOPILOT]
autopilot?.let{
cbAdasAutoPilot.isChecked = it.record
}
val dataTrack = traceInfoMap[ChainConstant.CHAIN_LINK_LOG_WEB_SOCKET_DATA_TRACKED]
dataTrack?.let {
cbAdasDataTrack.isChecked = it.record
}
val trajectory = traceInfoMap[ChainConstant.CHAIN_LINK_LOG_WEB_SOCKET_TRAJECTORY]
trajectory?.let {
cbAdasTrajectory.isChecked = it.record
}
val vehicle = traceInfoMap[ChainConstant.CHAIN_LINK_LOG_WEB_SOCKET_VEHICLE]
vehicle?.let {
cbAdasVehicle.isChecked = it.record
}
// 更新链路信息
refreshTraceInfo()
/**
* ADAS自动驾驶链路
@@ -1313,24 +1112,46 @@ class DebugSettingView @JvmOverloads constructor(
}
}
private fun refreshTraceInfo() {
val traceInfoMap = CallerDevaToolsManager.getTraceInfo()
val autopilot = traceInfoMap[ChainConstant.CHAIN_LINK_LOG_WEB_SOCKET_AUTOPILOT]
autopilot?.let {
cbAdasAutoPilot.isChecked = it.record
}
val dataTrack = traceInfoMap[ChainConstant.CHAIN_LINK_LOG_WEB_SOCKET_DATA_TRACKED]
dataTrack?.let {
cbAdasDataTrack.isChecked = it.record
}
val trajectory = traceInfoMap[ChainConstant.CHAIN_LINK_LOG_WEB_SOCKET_TRAJECTORY]
trajectory?.let {
cbAdasTrajectory.isChecked = it.record
}
val vehicle = traceInfoMap[ChainConstant.CHAIN_LINK_LOG_WEB_SOCKET_VEHICLE]
vehicle?.let {
cbAdasVehicle.isChecked = it.record
}
}
/**
* APK包管理
*/
private fun setApkCenterListener(){
val layoutManager: LinearLayoutManager = object : LinearLayoutManager(context,
VERTICAL, false) {
private fun setApkCenterListener() {
val layoutManager: LinearLayoutManager = object : LinearLayoutManager(
context,
VERTICAL, false
) {
override fun canScrollVertically(): Boolean {
// 直接禁止垂直滑动
return false
}
}
rvUpgradeVersionList.layoutManager =layoutManager
rvUpgradeVersionList.layoutManager = layoutManager
upgradeListAdapter = UpgradeListAdapter(context,upgradeVersionList,
object:UpgradeListAdapter.ClickListener{
override fun downloadApk(name: String,url: String) {
upgradeListAdapter = UpgradeListAdapter(context, upgradeVersionList,
object : UpgradeListAdapter.ClickListener {
override fun downloadApk(name: String, url: String) {
//下载包
CallerDevaToolsManager.downLoadPackage(name,url)
CallerDevaToolsManager.downLoadPackage(name, url)
ToastUtils.showLong("开始下载APK,稍后可前往downloads文件夹查看")
}
@@ -1340,9 +1161,9 @@ class DebugSettingView @JvmOverloads constructor(
ivApkSearch.setOnClickListener {
val searchStr = etApkSearch.text.toString()
if(searchStr.isEmpty()){
if (searchStr.isEmpty()) {
ToastUtils.showShort("请输入正确的搜索关键字")
}else{
} else {
CallerDevaToolsManager.getUpgradeVersionUrls(searchStr)
}
@@ -1370,11 +1191,11 @@ class DebugSettingView @JvmOverloads constructor(
private fun dataFilter(list: ArrayList<UpgradeVersionEntity>): ArrayList<UpgradeVersionEntity> {
val tempList = ArrayList<UpgradeVersionEntity>()
list.let {
it.iterator().forEach { entity->
if(onlineSelected && entity.name.contains("online")){
it.iterator().forEach { entity ->
if (onlineSelected && entity.name.contains("online")) {
tempList.add(entity)
}
if(qaSelected && entity.name.contains("qa")){
if (qaSelected && entity.name.contains("qa")) {
tempList.add(entity)
}
}
@@ -1413,10 +1234,15 @@ class DebugSettingView @JvmOverloads constructor(
AppConfigInfo.widevineIDMd5 =
DeviceIdUtils.getWidevineIDWithMd5(AbsMogoApplication.getApp())
}
AppConfigInfo.mogoSN = MoGoAiCloudClient.getInstance().aiCloudClientConfig.sn
AppConfigInfo.mogoToken = MoGoAiCloudClient.getInstance().aiCloudClientConfig.token
if (MoGoAiCloudClient.getInstance().aiCloudClientConfig != null) {
AppConfigInfo.mogoSN = MoGoAiCloudClient.getInstance().aiCloudClientConfig.sn
AppConfigInfo.mogoToken = MoGoAiCloudClient.getInstance().aiCloudClientConfig.token
}
AppConfigInfo.netMode = DebugConfig.getNetMode()
AppConfigInfo.mapSdkVersion = MogoMap.getInstance().mogoMap.mapVersion
if (MogoMap.getInstance().mogoMap != null) {
AppConfigInfo.mapSdkVersion = MogoMap.getInstance().mogoMap.mapVersion
}
AppConfigInfo.isConnectNet = NetworkUtils.isConnected(context)
AppConfigInfo.isConnectSocket = DebugConfig.isDownloadSnapshot()
@@ -1430,7 +1256,8 @@ class DebugSettingView @JvmOverloads constructor(
AppConfigInfo.isConnectedNetty = CallerTelematicManager.getClientConnStatus()
AppConfigInfo.serverIp = CallerTelematicManager.getServerIp()
}
else -> {}
else -> {
}
}
/**
@@ -1448,11 +1275,12 @@ class DebugSettingView @JvmOverloads constructor(
tvAppVersionName.text = "鹰眼版本名:${AppUtils.getAppVersionName()}"
tvAutopilotProtocolVersionInfo.text =
"Autopilot协议版本${CallerAutoPilotManager.getProtocolVersion()}"
if(AppConfigInfo.protocolVersionNumber==0){
tvIpcProtocolVersionInfo.text="工控机协议版本:未知"
}else{
if (AppConfigInfo.protocolVersionNumber == 0) {
tvIpcProtocolVersionInfo.text = "工控机协议版本:未知"
} else {
tvIpcProtocolVersionInfo.text = "工控机协议版本:${AppConfigInfo.protocolVersionNumber}"
}
tvIpcVersionInfo.text = "工控机镜像:${mAutoPilotStatusInfo?.dockVersion}"
tvMoGoMapVersion.text = "HD-Map版本${MogoMap.getInstance().mogoMap.mapVersion}"
tvGitBranchInfo.text = "Git分支${AppConfigInfo.workingBranchName}"
tvAppBuildTimeInfo.text = "版本构建时间:${AppConfigInfo.appBuildTime}"
@@ -1512,9 +1340,9 @@ class DebugSettingView @JvmOverloads constructor(
"<font color='blue'>正常"
} else {
"<font color='red'>异常 原因:${
if(AppConfigInfo.connectStatusDescribe.isNullOrEmpty()){
if (AppConfigInfo.connectStatusDescribe.isNullOrEmpty()) {
"主动断开连接"
}else{
} else {
AppConfigInfo.connectStatusDescribe
}
}"
@@ -1557,7 +1385,7 @@ class DebugSettingView @JvmOverloads constructor(
)
tvLocationEnabled.text = Html.fromHtml(
"定位服务开启状态:${
"Pad定位服务开启状态:${
if (DeviceUtils.isLocationEnabled()) {
"<font color='blue'>正常"
} else {
@@ -1616,30 +1444,40 @@ class DebugSettingView @JvmOverloads constructor(
AppConfigInfo.isConnectAutopilot = autoPilotStatusInfo.connectStatus
AppConfigInfo.connectStatusDescribe = autoPilotStatusInfo.connectStatusDescribe
// if (autoPilotStatusInfo.connectStatus) {
// adasConnectStatus = true
// }
//ADAS断开连接提示异常
// if (adasConnectStatus && !autoPilotStatusInfo.connectStatus) {
// adasConnectStatus = false
// toastMsg("工控机连接断开")
// }
}
override fun onAutopilotCarStateData(gnssInfo: MessagePad.GnssInfo?) {
mGnssInfo = gnssInfo
//实时加速度列表
ThreadUtils.runOnUiThread{
if(accelerationIsShow){
if(accelerationList.size > 9){
ThreadUtils.runOnUiThread {
if (accelerationIsShow) {
if (accelerationList.size > 9) {
accelerationList.removeLast()
}
gnssInfo?.acceleration?.let {
if(accelerationList.isEmpty()){
accelerationList.add(AccelerationEntity(TimeUtils.millis2String(System.currentTimeMillis(),TimeUtils.getHourMinSecondFormat()),it.toString()))
if (accelerationList.isEmpty()) {
accelerationList.add(
AccelerationEntity(
TimeUtils.millis2String(
System.currentTimeMillis(),
TimeUtils.getHourMinSecondFormat()
), it.toString()
)
)
}
if(abs(it.minus(accelerationList.first().acceleration.toDouble())) > abs(accelerationThresholdNum)){
accelerationList.add(0, AccelerationEntity(TimeUtils.millis2String(System.currentTimeMillis(),TimeUtils.getHourMinSecondFormat()),it.toString()))
if (abs(it.minus(accelerationList.first().acceleration.toDouble())) > abs(
accelerationThresholdNum
)
) {
accelerationList.add(
0,
AccelerationEntity(
TimeUtils.millis2String(
System.currentTimeMillis(),
TimeUtils.getHourMinSecondFormat()
), it.toString()
)
)
}
accelerationFloatWindow?.refreshData(accelerationList)
@@ -1698,13 +1536,15 @@ class DebugSettingView @JvmOverloads constructor(
tvReportCode.text = "code:${it.code}"
var resultStr = "result:"
for (result in it.resultList) {
resultStr = "$resultStr$result${CallerAutoPilotManager.getReportResultDesc(result)} "
resultStr =
"$resultStr$result${CallerAutoPilotManager.getReportResultDesc(result)} "
}
tvReportResult.text = resultStr
var actionStr = "action:"
for (action in it.actionsList) {
actionStr = "$actionStr$action${CallerAutoPilotManager.getReportActionDesc(action)} "
actionStr =
"$actionStr$action${CallerAutoPilotManager.getReportActionDesc(action)} "
}
tvReportActions.text = actionStr
@@ -1744,7 +1584,7 @@ class DebugSettingView @JvmOverloads constructor(
* 时延显示
*/
override fun onObuV2iDelayTime(delayTime: Long) {
ThreadUtils.runOnUiThread{
ThreadUtils.runOnUiThread {
tvObuDelay.text = "obu时延" + delayTime.toString()
}
}
@@ -1770,7 +1610,7 @@ class DebugSettingView @JvmOverloads constructor(
* @param steering 方向盘转向角
*/
override fun onAutopilotSteeringData(steering: Float) {
ThreadUtils.runOnUiThread{
ThreadUtils.runOnUiThread {
tvSteeringInfo.text = "方向盘转向角:${steering}"
}
}
@@ -1780,7 +1620,7 @@ class DebugSettingView @JvmOverloads constructor(
* @param gear 档位
*/
override fun onAutopilotGearData(gear: Chassis.GearPosition) {
ThreadUtils.runOnUiThread{
ThreadUtils.runOnUiThread {
tvGearInfo.text = "挂挡档位:${gear}"
}
}
@@ -1799,7 +1639,7 @@ class DebugSettingView @JvmOverloads constructor(
this.clickListener = clickListener
}
interface ClickListener{
interface ClickListener {
fun showReportListWindow(show: Boolean)
}

View File

@@ -0,0 +1,60 @@
package com.mogo.eagle.core.function.hmi.ui.setting
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.TextView
import androidx.recyclerview.widget.RecyclerView
import com.mogo.eagle.core.data.report.ReportEntity
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager
import com.mogo.eagle.core.function.hmi.R
/**
* @author XuXinChao
* @description 工控机异常节点上报适配器
* @since: 2022/5/12
*/
class IPCReportAdapter: RecyclerView.Adapter<IPCReportAdapter.IPCReportHolder>(){
private var data:List<ReportEntity>? = null
fun setData( data: List<ReportEntity>?){
this.data = data
}
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): IPCReportHolder {
val view = LayoutInflater.from(parent.context)
.inflate(R.layout.item_ipc_report, parent, false)
return IPCReportHolder(view)
}
override fun onBindViewHolder(holder: IPCReportHolder, position: Int) {
data?.let {it ->
val reportEntity = it[position]
reportEntity.let {
holder.tvReportTimeContent.text = it.time
var resultStr = "发生异常"
for (result in it.resultList){
resultStr = "${resultStr}-${CallerAutoPilotManager.getReportResultDesc(result)}"
}
holder.tvReportResultContent.text = resultStr
holder.tvReportMsgContent.text = it.msg
var actionStr = ""
for (action in it.actionsList){
actionStr = "${actionStr}-${CallerAutoPilotManager.getReportActionDesc(action)}"
}
holder.tvReportActionContent.text = actionStr
}
}
}
override fun getItemCount() = data?.size ?: 0
class IPCReportHolder(itemView: View) : RecyclerView.ViewHolder(itemView){
var tvReportTimeContent: TextView = itemView.findViewById(R.id.tvReportTimeContent)
var tvReportResultContent: TextView = itemView.findViewById(R.id.tvReportResultContent)
var tvReportMsgContent: TextView = itemView.findViewById(R.id.tvReportMsgContent)
var tvReportActionContent: TextView = itemView.findViewById(R.id.tvReportActionContent)
}
}

View File

@@ -0,0 +1,126 @@
package com.mogo.eagle.core.function.hmi.ui.setting
import android.app.Activity
import android.graphics.PixelFormat
import android.util.DisplayMetrics
import android.view.*
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import com.mogo.eagle.core.data.report.ReportEntity
import com.mogo.eagle.core.function.hmi.R
import java.lang.reflect.Field
/**
* @author XuXinChao
* @description 工控机异常节点上报
* @since: 2022/5/12
*/
class IPCReportWindow constructor(activity: Activity) : View.OnTouchListener{
private var mActivity: Activity = activity
private var mWindowParams: WindowManager.LayoutParams? = null
private var mWindowManager: WindowManager? = null
private lateinit var rvIPCReport: RecyclerView
private var ipcReportAdapter: IPCReportAdapter?=null
private lateinit var mFloatLayout: View
private var mInViewX = 0f
private var mInViewY = 0f
private var mDownInScreenX = 0f
private var mDownInScreenY = 0f
private var mInScreenX = 0f
private var mInScreenY = 0f
init {
initFloatWindow();
}
private fun initFloatWindow(){
mFloatLayout = LayoutInflater.from(mActivity).inflate(R.layout.view_ipc_report, null) as View
mFloatLayout.setOnTouchListener(this)
rvIPCReport= mFloatLayout.findViewById(R.id.rv_ipc_report)
mWindowParams = WindowManager.LayoutParams()
mWindowManager = mActivity.windowManager
mWindowParams?.let {
it.format = PixelFormat.RGBA_8888
it.flags = WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE
it.gravity = Gravity.START or Gravity.TOP
it.width = 800
it.height = 1000
it.alpha = 0.9f
}
ipcReportAdapter = IPCReportAdapter()
rvIPCReport.layoutManager = LinearLayoutManager(mActivity,
LinearLayoutManager.VERTICAL,false)
rvIPCReport.adapter = ipcReportAdapter
}
fun refreshData(data:List<ReportEntity>){
ipcReportAdapter?.setData(data)
ipcReportAdapter?.notifyDataSetChanged()
}
override fun onTouch(v: View?, motionEvent: MotionEvent?): Boolean {
when (motionEvent?.action) {
MotionEvent.ACTION_DOWN -> {
// 获取相对View的坐标即以此View左上角为原点
mInViewX = motionEvent.x
mInViewY = motionEvent.y
// 获取相对屏幕的坐标,即以屏幕左上角为原点
mDownInScreenX = motionEvent.rawX
mDownInScreenY = motionEvent.rawY - getSysBarHeight(mActivity)
mInScreenX = motionEvent.rawX
mInScreenY = motionEvent.rawY - getSysBarHeight(mActivity)
}
MotionEvent.ACTION_MOVE -> {
// 更新浮动窗口位置参数
mInScreenX = motionEvent.rawX
mInScreenY = motionEvent.rawY - getSysBarHeight(mActivity)
mWindowParams!!.x = (mInScreenX - mInViewX).toInt()
mWindowParams!!.y = (mInScreenY - mInViewY).toInt()
// 手指移动的时候更新小悬浮窗的位置
mWindowManager!!.updateViewLayout(mFloatLayout, mWindowParams)
}
// MotionEvent.ACTION_UP -> // 如果手指离开屏幕时xDownInScreen和xInScreen相等且yDownInScreen和yInScreen相等则视为触发了单击事件。
// if (mDownInScreenX === mInScreenX && mDownInScreenY === mInScreenY) {
// }
}
return true
}
fun showFloatWindow() {
if (mFloatLayout.parent == null) {
val metrics = DisplayMetrics()
// 默认固定位置,靠屏幕右边缘的中间
mWindowManager!!.defaultDisplay.getMetrics(metrics)
mWindowParams!!.x = metrics.widthPixels
mWindowParams!!.y = metrics.heightPixels / 2 - getSysBarHeight(mActivity)
mWindowManager!!.addView(mFloatLayout, mWindowParams)
}
}
fun hideFloatWindow() {
if (mFloatLayout.parent != null) mWindowManager!!.removeView(mFloatLayout)
}
// 获取系统状态栏高度
private fun getSysBarHeight(activity: Activity): Int {
val c: Class<*>
val obj: Any
val field: Field
val x: Int
var sbar = 0
try {
c = Class.forName("com.android.internal.R\$dimen")
obj = c.newInstance()
field = c.getField("status_bar_height")
x = field.get(obj).toString().toInt()
sbar = activity.resources.getDimensionPixelSize(x)
} catch (e1: Exception) {
e1.printStackTrace()
}
return sbar
}
}

View File

@@ -2,6 +2,7 @@ package com.mogo.eagle.core.function.hmi.ui.widget
import android.animation.ValueAnimator
import android.content.Context
import android.content.res.Resources
import android.content.res.TypedArray
import android.graphics.*
import android.util.AttributeSet
@@ -87,8 +88,6 @@ class CircularProgressView @JvmOverloads constructor(
Log.d(TAG, mRectL.toString() + "," + mRectT.toString())
Log.d(TAG, mRectF.toString() + "," + "width:" + measuredWidth.toString() + "," + "PaddingLeft:" + getPaddingLeft().toString())
}
override fun onDraw(canvas: Canvas?) {

View File

@@ -5,23 +5,22 @@ import android.util.AttributeSet;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.animation.LinearInterpolator;
import android.view.animation.RotateAnimation;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.UiThread;
import androidx.constraintlayout.widget.ConstraintLayout;
import com.mogo.eagle.core.data.autopilot.AutopilotStatusInfo;
import com.mogo.eagle.core.data.config.FunctionBuildConfig;
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener;
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotVehicleStateListener;
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager;
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotVehicleStateListenerManager;
import com.mogo.eagle.core.function.hmi.R;
import com.mogo.eagle.core.network.utils.Util;
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils;
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
import com.mogo.eagle.core.utilcode.util.ThreadUtils;
@@ -47,6 +46,7 @@ public class SteeringWheelView extends ConstraintLayout {
private TextView steeringTVR;
private TapPositionView tapPositionView;
private CircularProgressView steeringCircularV;
private CircularProgressView steeringCircularVAlpha;
private RotateAnimation rotateAnimation;
private float fromDegrees = 0;//方向盘旋转起始位置
@@ -58,7 +58,11 @@ public class SteeringWheelView extends ConstraintLayout {
public SteeringWheelView(@NonNull Context context, @Nullable AttributeSet attrs) {
super(context, attrs);
Log.d(TAG, "2");
LayoutInflater.from(context).inflate(R.layout.hmi_steering_wheel, this);
if (AppIdentityModeUtils.isBus(FunctionBuildConfig.appIdentityMode)) {
LayoutInflater.from(context).inflate(R.layout.hmi_steering_wheel_bus, this);
} else {
LayoutInflater.from(context).inflate(R.layout.hmi_steering_wheel_taxi, this);
}
initView();
CallerAutoPilotStatusListenerManager.INSTANCE.addListener(TAG, mGoAutopilotStatusListener);
CallerAutopilotVehicleStateListenerManager.INSTANCE.addListener(TAG, mIMoGoAutopilotVehicleStateListener);
@@ -74,6 +78,13 @@ public class SteeringWheelView extends ConstraintLayout {
steeringCircularV.setBackColor(R.color.hmi_light_blue_00);
steeringCircularV.setProgColor(R.color.hmi_light_blue, R.color.hmi_dark_blue);
steeringCircularV.setProgress((int) (180 * 100) / 360, 1000);
if (AppIdentityModeUtils.isTaxi(FunctionBuildConfig.appIdentityMode)){
steeringCircularVAlpha = findViewById(R.id.steering_circular_alpha);
steeringCircularVAlpha.setAlpha(0.4f);
steeringCircularVAlpha.setBackColor(R.color.hmi_light_blue_00);
steeringCircularVAlpha.setProgColor(R.color.hmi_light_blue_alpha);
steeringCircularVAlpha.setProgress((int) (180 * 100) / 360, 1000);
}
}
public SteeringWheelView(@NonNull Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
@@ -151,7 +162,7 @@ public class SteeringWheelView extends ConstraintLayout {
}
/**
* 方向盘转向角
* 方向盘转向角 左+右-
* @param steering
*/
@Override
@@ -159,12 +170,12 @@ public class SteeringWheelView extends ConstraintLayout {
ThreadUtils.runOnUiThread(new Runnable() {
@Override
public void run() {
Log.d(TAG, "steering" + String.valueOf(steering));
if (steeringTVL != null && steering < 0) {
Log.d(TAG, "steering====" + String.valueOf(steering));
if (steeringTVL != null && steering > 0) {
steeringTVR.setVisibility(View.INVISIBLE);
steeringTVL.setVisibility(View.VISIBLE);
steeringTVL.setText(String.valueOf((int) steering) + "°");
} else if (steeringTVR != null && steering >= 0) {
} else if (steeringTVR != null && steering <= 0) {
steeringTVL.setVisibility(View.INVISIBLE);
steeringTVR.setVisibility(View.VISIBLE);
steeringTVR.setText(String.valueOf((int) steering) + "°");
@@ -172,7 +183,7 @@ public class SteeringWheelView extends ConstraintLayout {
Log.d(TAG, "onAutopilotSteeringData error");
}
animationWithSteeringData(steering);
steeringCircularV.setProgress((int) (steering * 100) / 360, 1000);
steeringCircularV.setProgress((int) (-steering * 100) / 360, 1000);
}
});

View File

@@ -104,6 +104,7 @@ class SystemVersionView @JvmOverloads constructor(
CallerLogger.i("$M_HMI$$TAG", "upgrade confirm")
//设置当前状态为“升级中”
AdUpgradeStateHelper.setUpgradeStatus(true)
//TODO
CallerAutoPilotManager.setIPCUpgradeAffirm()
//将角标设为升级中
ivAdStatus?.setImageResource(R.drawable.icon_upgrading)

View File

@@ -4,7 +4,9 @@ import android.content.Context
import android.util.AttributeSet
import android.view.LayoutInflater
import androidx.constraintlayout.widget.ConstraintLayout
import com.mogo.eagle.core.data.config.FunctionBuildConfig
import com.mogo.eagle.core.function.hmi.R
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
import kotlinx.android.synthetic.main.view_vip_identification.view.*
@@ -21,6 +23,20 @@ class VipIdentificationView @JvmOverloads constructor(
LayoutInflater.from(context).inflate(R.layout.view_vip_identification, this, true)
}
override fun onAttachedToWindow() {
super.onAttachedToWindow()
val lp = this.layoutParams as LayoutParams
if (AppIdentityModeUtils.isBus(FunctionBuildConfig.appIdentityMode)) {
lp.marginStart = resources.getDimension(R.dimen.module_vip_margin_left_bus).toInt()
lp.topMargin = resources.getDimension(R.dimen.module_vip_margin_top_bus).toInt()
} else {
lp.marginStart = resources.getDimension(R.dimen.module_vip_margin_left_taxi).toInt()
lp.topMargin = resources.getDimension(R.dimen.module_vip_margin_top_taxi).toInt()
}
this.layoutParams = lp
invalidate()
}
fun setVipIdentificationVisible(visible: Boolean) {
UiThreadHandler.post {
ivVipIdentification.visibility = visibility

View File

@@ -0,0 +1,70 @@
package com.mogo.eagle.core.function.main;
import android.annotation.SuppressLint;
import android.content.Context;
import android.graphics.Color;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import com.mogo.eagle.core.data.autopilot.AutopilotStatusInfo;
import com.mogo.eagle.core.function.hmi.R;
import java.util.List;
public class ConnInfoAdapter extends RecyclerView.Adapter<ConnInfoAdapter.ConnInfoViewHolder> {
private List<AutopilotStatusInfo> data;
private Context context;
public ConnInfoAdapter(Context context, List<AutopilotStatusInfo> data) {
this.data = data;
this.context = context;
}
public void updateData(AutopilotStatusInfo statusInfo) {
if (data.size() > 999) {
data.clear();
}
data.add(statusInfo);
notifyDataSetChanged();
}
@NonNull
@Override
public ConnInfoViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
View view = LayoutInflater.from(context).inflate(R.layout.autopilot_connect_status_item, parent, false);
return new ConnInfoViewHolder(view);
}
@SuppressLint("ResourceAsColor")
@Override
public void onBindViewHolder(@NonNull ConnInfoViewHolder holder, int position) {
AutopilotStatusInfo statusInfo = data.get(position);
if (statusInfo.getConnectStatus()) {
holder.mContentView.setTextColor(Color.parseColor("#FFFFFF"));
} else {
holder.mContentView.setTextColor(Color.parseColor("#FF4040"));
}
holder.mContentView.setText(statusInfo.toString());
}
@Override
public int getItemCount() {
return data != null ? data.size() : 0;
}
public static class ConnInfoViewHolder extends RecyclerView.ViewHolder {
private TextView mContentView;
public ConnInfoViewHolder(@NonNull View itemView) {
super(itemView);
mContentView = itemView.findViewById(R.id.tvStatusInfo);
}
}
}

View File

@@ -15,18 +15,26 @@ import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.constraintlayout.widget.ConstraintLayout;
import androidx.fragment.app.Fragment;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.alibaba.android.arouter.launcher.ARouter;
import com.mogo.cloud.commons.BuildConfig;
import com.mogo.commons.context.ContextHolderUtil;
import com.mogo.commons.mvp.BaseFragment;
import com.mogo.commons.mvp.MvpActivity;
import com.mogo.commons.mvp.MvpFragment;
import com.mogo.eagle.core.data.autopilot.AutopilotStatusInfo;
import com.mogo.eagle.core.data.constants.MoGoFragmentPaths;
import com.mogo.eagle.core.data.map.MogoLocation;
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener;
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager;
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager;
import com.mogo.eagle.core.function.hmi.R;
import com.mogo.eagle.core.function.main.cards.MogoModulesManager;
import com.mogo.eagle.core.function.main.service.MogoMainService;
import com.mogo.eagle.core.function.main.stagetwo.APMStartup;
import com.mogo.eagle.core.function.main.stagetwo.AutopilotStartup;
import com.mogo.eagle.core.function.main.utils.DisplayEffectsHelper;
import com.mogo.eagle.core.function.main.windowview.FloatingViewHandler;
import com.mogo.eagle.core.utilcode.mogo.AppLaunchTimeUtils;
@@ -44,10 +52,18 @@ import com.mogo.module.common.MogoApisHandler;
import com.mogo.service.IMogoServiceApis;
import com.mogo.service.fragmentmanager.FragmentStackTransactionListener;
import com.mogo.service.statusmanager.IMogoStatusManager;
import com.rousetime.android_startup.StartupManager;
import com.rousetime.android_startup.model.LoggerLevel;
import com.rousetime.android_startup.model.StartupConfig;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import mogo.telematics.pad.MessagePad;
import mogo_msg.MogoReportMsg;
/**
* @author congtaowang
* @since 2019-12-23
@@ -56,7 +72,8 @@ import java.util.Map;
*/
public class MainActivity extends MvpActivity<MainView, MainPresenter> implements MainView,
IMogoLocationListener,
FragmentStackTransactionListener {
FragmentStackTransactionListener,
IMoGoAutopilotStatusListener {
protected static final String TAG = "MainActivity";
private static final int REQUEST_CODE_DIALOG = 100;
@@ -71,6 +88,11 @@ public class MainActivity extends MvpActivity<MainView, MainPresenter> implement
private boolean isFirst = false;
private RecyclerView mConnectInfoRV;
private ConnInfoAdapter mConnAdapter;
private List<AutopilotStatusInfo> dataList = new ArrayList<>();
private boolean isFloatingLayerHidden = false;
@Override
protected int getLayoutId() {
return R.layout.module_main_activity_main;
@@ -89,10 +111,10 @@ public class MainActivity extends MvpActivity<MainView, MainPresenter> implement
mCoverUpLayout = findViewById(R.id.module_main_id_cover_up);
clSpecialEffect = findViewById(R.id.cl_special_effect);
mConnectInfoRV = findViewById(R.id.rvConnectInfo);
initConnectInfoRV();
FloatingViewHandler.init(mFloatingLayout);
//申请悬浮窗权限
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
// 检查是否有悬浮窗权限
@@ -118,6 +140,9 @@ public class MainActivity extends MvpActivity<MainView, MainPresenter> implement
super.onCreate(savedInstanceState);
calculateStartTime();
ContextHolderUtil.holdContext(this);
// 监听工控机连接信息
CallerAutoPilotStatusListenerManager.INSTANCE.addListener(TAG, this);
startUpInStage2();
// 加载模块
mPresenter.postLoadModuleMsg();
// 监听网络状态
@@ -171,6 +196,32 @@ public class MainActivity extends MvpActivity<MainView, MainPresenter> implement
mMogoStatusManager.setMainPageLaunchedStatus(TAG, true);
}
private void initConnectInfoRV() {
mConnAdapter = new ConnInfoAdapter(this, dataList);
mConnectInfoRV.setLayoutManager(new LinearLayoutManager(this));
mConnectInfoRV.setAdapter(mConnAdapter);
}
/**
* 第二阶段初始化,第一阶段初始化可查看:{@link com.mogo.launcher.stageone}
*/
public void startUpInStage2() {
StartupConfig config = null;
if (BuildConfig.DEBUG) {
config = new StartupConfig.Builder()
.setLoggerLevel(LoggerLevel.DEBUG)
.setOpenStatistics(true)
.build();
}
new StartupManager.Builder()
.addStartup(new AutopilotStartup())
.addStartup(new APMStartup())
.setConfig(config)
.build(this)
.start()
.await();
}
@Override
public void loadModules() {
final long start = System.currentTimeMillis();
@@ -186,7 +237,7 @@ public class MainActivity extends MvpActivity<MainView, MainPresenter> implement
EventDispatchCenter.getInstance().setMapLoadedCallback(() -> {
CallerLogger.INSTANCE.d(M_HMI + TAG, "map loaded." + Thread.currentThread().getName());
// 延时加载其他模块
getWindow().getDecorView().postDelayed(() -> {
getWindow().getDecorView().post(() -> {
loadOthersModules();
loadFunctionFragment();
@@ -194,7 +245,7 @@ public class MainActivity extends MvpActivity<MainView, MainPresenter> implement
MogoApisHandler.getInstance().getApis().getStatusManagerApi().setVrMode(TAG, true);
// 设置地图样式
MogoMapListenerHandler.getInstance().onMapModeChanged(EnumMapUI.MAP_STYLE_DAY_VR);
}, 1000);
});
CallerLogger.INSTANCE.i(M_HMI + TAG, "App launch timer cost " + (System.currentTimeMillis() - start) + "ms");
});
@@ -239,8 +290,10 @@ public class MainActivity extends MvpActivity<MainView, MainPresenter> implement
@Override
public void hideCoverUpLayout() {
mConnectInfoRV.setVisibility(View.GONE);
getWindow().setBackgroundDrawable(null);
mCoverUpLayout.setVisibility(View.GONE);
isFloatingLayerHidden = true;
}
@Override
@@ -317,9 +370,33 @@ public class MainActivity extends MvpActivity<MainView, MainPresenter> implement
return mServiceApis;
}
@Override
public void onAutopilotStatusResponse(@NonNull AutopilotStatusInfo autoPilotStatusInfo) {
mConnectInfoRV.post(() -> updateConnectInfoView(autoPilotStatusInfo));
}
@Override
public void onAutopilotArriveAtStation(@Nullable MessagePad.ArrivalNotification arrivalNotification) {}
@Override
public void onAutopilotGuardian(@Nullable MogoReportMsg.MogoReportMessage guardianInfo) {}
@Override
public void onAutopilotSNRequest() {}
private void updateConnectInfoView(@NonNull AutopilotStatusInfo autoPilotStatusInfo) {
if (!isFloatingLayerHidden) {// 遮罩层显示的时候
mConnAdapter.updateData(autoPilotStatusInfo);
mConnectInfoRV.scrollToPosition(mConnAdapter.getItemCount() - 1);
} else {// 遮罩层隐藏的时候
CallerAutoPilotStatusListenerManager.INSTANCE.removeListener(TAG);
}
}
@Override
protected void onDestroy() {
super.onDestroy();
CallerAutoPilotStatusListenerManager.INSTANCE.removeListener(TAG);
IMogoHosListenerRegister listenerRegister = CallerMapUIServiceManager.INSTANCE.getHostListenerRegister();
if (listenerRegister != null) {
listenerRegister.unregisterMarkerClickListener();

View File

@@ -6,25 +6,14 @@ import android.content.Context;
import android.os.Process;
import com.bytedance.boost_multidex.BoostMultiDex;
import com.mogo.aicloud.services.locationinfo.MogoLocationInfoServices;
import com.mogo.aicloud.services.socket.MogoAiCloudSocketManager;
import com.mogo.cloud.httpdns.MogoHttpDnsConfig;
import com.mogo.cloud.httpdns.bean.HttpDnsSimpleLocation;
import com.mogo.cloud.passport.IMoGoTokenCallback;
import com.mogo.cloud.passport.MoGoAiCloudClient;
import com.mogo.cloud.passport.MoGoAiCloudClientConfig;
import com.mogo.cloud.socket.SocketBuildConfig;
import com.mogo.commons.AbsMogoApplication;
import com.mogo.commons.constants.SharedPrefsConstants;
import com.mogo.commons.debug.DebugConfig;
import com.mogo.commons.network.Utils;
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.map.MogoLocation;
import com.mogo.eagle.core.function.api.chat.biz.ChatConsts;
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager;
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager;
import com.mogo.eagle.core.function.notice.PushUIConstants;
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils;
import com.mogo.eagle.core.utilcode.mogo.AppLaunchTimeUtils;
@@ -32,16 +21,10 @@ import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr;
import com.mogo.eagle.core.utilcode.util.ProcessUtils;
import com.mogo.map.MapApiPath;
import com.mogo.map.location.IMogoLocationClient;
import com.mogo.module.common.MogoModule;
import com.mogo.module.common.MogoModulePaths;
import com.mogo.module.common.constants.HostConst;
import com.mogo.module.service.ServiceConst;
import com.mogo.aicloud.services.socket.IMogoLifecycleListener;
import com.mogo.test.crashreport.CrashReportConstants;
import com.mogo.test.crashreport.upgrade.UpgradeReportConstants;
import com.zhidao.support.obu.ami.AmiClientManager;
import com.zhjt.mogo_core_function_devatools.DevaToolsProvider;
import java.lang.reflect.Field;
@@ -57,19 +40,17 @@ public abstract class MainMoGoApplication extends AbsMogoApplication {
@Override
public void onCreate() {
initBuildConfig();
initConfigWithSP();
super.onCreate();
if (!shouldInit()) {
return;
}
start = System.currentTimeMillis();
connectAmiIp();
// Crash 日志收集
initCrashConfig();
initLogConfig();
initTipToast();
initModules();
initCloudClientConfig();
}
@Override
@@ -78,26 +59,11 @@ public abstract class MainMoGoApplication extends AbsMogoApplication {
return ProcessUtils.isMainProcess(this);
}
/**
* BuildConfig中渠道配置赋值
*/
protected abstract void initBuildConfig();
/**
* 从SP本地设置中恢复数据
*/
protected abstract void initConfigWithSP();
/**
* 初始化异常采集配置
*/
protected abstract void initCrashConfig();
/**
* 初始化异常采集配置
*/
protected abstract void initAnalyticsConfig();
/**
* 初始化日志
*/
@@ -115,149 +81,6 @@ public abstract class MainMoGoApplication extends AbsMogoApplication {
CallerDevaToolsManager.INSTANCE.init(this);
}
/**
* 初始化 MoGoAiCloudClientConfig
*/
protected abstract void initCloudClientConfig();
@Override
protected void asyncInitImpl() {
super.asyncInitImpl();
initAnalyticsConfig();
}
@Override
protected void initHttpDns() {
super.initHttpDns();
prepareBaseService();
}
/**
* 基础服务passport、location、socket
*/
private void prepareBaseService() {
// 第三方平台的sn是由AI云SDK中服务调用通过服务端生成的
preparePassportEnvironment();
}
private void preparePassportEnvironment() {
// 设置网络环境HTTP_DNS_ENV_QA、HTTP_DNS_ENV_RELEASE、HTTP_DNS_ENV_DEV
switch (DebugConfig.getNetMode()) {
case DebugConfig.NET_MODE_DEV:
clientConfig.setNetMode(MogoHttpDnsConfig.HTTP_DNS_ENV_DEV);
break;
case DebugConfig.NET_MODE_QA:
clientConfig.setNetMode(MogoHttpDnsConfig.HTTP_DNS_ENV_QA);
break;
case DebugConfig.NET_MODE_DEMO:
clientConfig.setNetMode(MogoHttpDnsConfig.HTTP_DNS_ENV_DEMO);
break;
default:
clientConfig.setNetMode(MogoHttpDnsConfig.HTTP_DNS_ENV_RELEASE);
}
// 设置是否是第三APP登录
clientConfig.setThirdLogin(DebugConfig.getCarMachineType() != DebugConfig.CAR_MACHINE_TYPE_SELF_INNOVATE);
// 设置是否输出日志
clientConfig.setShowDebugLog(true);
// 设置是否输出网络日志
clientConfig.setShowNetDebugLog(false);
// 设置是否是直播推流的主播
clientConfig.setAnchor(true);
// 设置从蘑菇AI开放平台获取的APPKey
switch (DebugConfig.getCarMachineType()) {
// 比亚迪
case DebugConfig.CAR_MACHINE_TYPE_BYD:
clientConfig.setThirdPartyAppKey("bydauto");
break;
// 衡阳-鹰眼项目
case DebugConfig.CAR_MACHINE_TYPE_LENOVO:
clientConfig.setThirdPartyAppKey("pfieouqg");
break;
// 自研车机
default:
clientConfig.setThirdPartyAppKey("wbvpzgar");
break;
}
// 设置应用服务AppId 长链、鉴权
if (DebugConfig.getNetMode() == DebugConfig.NET_MODE_RELEASE) {
clientConfig.setServiceAppId("com_mogo_launcher");
} else {
clientConfig.setServiceAppId("com.mogo.launcher");
}
// 设置AI云平台分配给三方应用的签名密钥需要从AI云平台申请
// 设置车机设备的唯一标识(这些表识必须是通过后台录入的设备)
clientConfig.setThirdPartyDeviceId(Utils.getDevicesId());
// 设置循环检测间隔时间每隔2小时loop一次httpDnsConfig
clientConfig.setLoopCheckDelay(60 * 60 * 2 * 1000);
//设置长链接的secretKey //todo 通过SHA1和包名找中台服务生成后续包名分渠道,需要做对应操作
clientConfig.setSecretKey("YMj2VFDFxJ3Q4gNoZceJ");
//连接ami
connectAmiIp();
// todo 使用旧链路
// clientConfig.setUseOriginSocket(true);
clientConfig.setIHttpDnsCurrentLocation(() -> {
MogoLocation mogoLocation = null;
IMogoLocationClient locationClient = CallerMapUIServiceManager.INSTANCE.getSingletonLocationClient(getApp());
if (locationClient != null) {
mogoLocation = locationClient.getLastKnowLocation();
}
HttpDnsSimpleLocation httpDnsSimpleLocation;
if (mogoLocation != null
&& mogoLocation.getLatitude() != 0
&& mogoLocation.getLongitude() != 0) {
httpDnsSimpleLocation = new HttpDnsSimpleLocation(
mogoLocation.getCityCode(),
mogoLocation.getLatitude(),
mogoLocation.getLongitude());
} else {
String ciyCode = SharedPrefsMgr.getInstance(getApp())
.getString(SharedPrefsConstants.LOCATION_CITY_CODE);
String latitude = SharedPrefsMgr.getInstance(getApp())
.getString(SharedPrefsConstants.LOCATION_LATITUDE);
String longitude = SharedPrefsMgr.getInstance(getApp())
.getString(SharedPrefsConstants.LOCATION_LONGITUDE);
try {
httpDnsSimpleLocation = new HttpDnsSimpleLocation(
ciyCode,
Double.parseDouble(latitude),
Double.parseDouble(longitude));
} catch (NumberFormatException e) {
// e.printStackTrace();
httpDnsSimpleLocation = new HttpDnsSimpleLocation("010", 1, 1);
}
//CallerLogger.INSTANCE.d(M_HMI + TAG, "使用缓存GPS信息" + httpDnsSimpleLocation);
}
return httpDnsSimpleLocation;
});
// 初始化SDK可以设置状态回调来监听
MoGoAiCloudClient.getInstance().init(this, clientConfig).addTokenCallbacks(
new IMoGoTokenCallback() {
@Override
public void onTokenGot(String token, String sn) {
CallerLogger.INSTANCE.d(M_HMI + TAG, "onTokenGot ");
clientConfig.setToken(token);
// 异步初始化NetConfig
asyncInit();
// HttpDns ttl回调 --- socketTTL
registerSocketHttpDnsTTL(HostConst.SOCKET_CENTER_DOMAIN);
// 开启每5s/次定位上报
uploadLocPerFiveSecond();
}
@Override
public void onError(int code, String msg) {
CallerLogger.INSTANCE.d(M_HMI + TAG, "初始化MogoAiCloudSdk failed ,reason : " + msg + " , 未能开启长链服务和初始化Modules服务");
}
}
);
}
/**
* 连接ami
*/
@@ -266,69 +89,15 @@ public abstract class MainMoGoApplication extends AbsMogoApplication {
AmiClientManager.getInstance().setObuIp(ipAddress);
}
/**
* 上传自车位置信息到云端
*/
private void uploadLocPerFiveSecond() {
if (DebugConfig.getCarMachineType() != DebugConfig.CAR_MACHINE_TYPE_SELF_INNOVATE) {
MogoLocationInfoServices.getInstance().init(getApplicationContext());
MogoLocationInfoServices.getInstance().start();
IMogoLocationClient locationClient = CallerMapUIServiceManager.INSTANCE.getSingletonLocationClient(getApplicationContext());
if (locationClient != null) {
locationClient.addLocationListener(location -> MogoLocationInfoServices.getInstance().provideLocation(location));
}
}
}
private void startSocketService() {
CallerLogger.INSTANCE.d(M_HMI + TAG, "startSocketService");
MogoLocation location = CallerMapUIServiceManager.INSTANCE.getSingletonLocationClient(getApp()).getLastKnowLocation();
// 关闭长链服务
MogoAiCloudSocketManager.getInstance(getApplicationContext()).destroy();
MogoAiCloudSocketManager.getInstance(getApplicationContext()).registerLifecycleListener(10020, new IMogoLifecycleListener() {
@Override
public void onConnectFailure() {
CallerLogger.INSTANCE.d(M_HMI + TAG, "socket-onConnectFailure");
DebugConfig.setDownloadSnapshot(false);
}
@Override
public void onConnectSuccess() {
CallerLogger.INSTANCE.d(M_HMI + TAG, "socket-onConnectSuccess");
DebugConfig.setDownloadSnapshot(true);
}
@Override
public void onConnectLost() {
CallerLogger.INSTANCE.d(M_HMI + TAG, "socket-onConnectLost");
DebugConfig.setDownloadSnapshot(false);
}
});
// 开启Socket长链服务
double lat = location.getLatitude();
double lon = location.getLongitude();
MogoAiCloudSocketManager.getInstance(getApplicationContext()).init(getApplicationContext(), DebugConfig.getSocketAppId(), lat, lon);
}
@Override
protected void socketTTL() {
// 鉴权成功后开启socket长链服务
startSocketService();
}
private void initModules() {
CallerLogger.INSTANCE.d(M_HMI + TAG, "initModules");
// 初始化 bugly 升级
MogoModulePaths.addBaseModule(new MogoModule(UpgradeReportConstants.PATH, UpgradeReportConstants.NAME));
// 初始化 apm 日志采集
MogoModulePaths.addBaseModule(new MogoModule(CrashReportConstants.PATH, CrashReportConstants.NAME));
//och模块
MogoModulePaths.addModuleFunction(new MogoModule("/och/api", "IMoGoFunctionProvider"));
MogoModulePaths.addBaseModule(new MogoModule(MapApiPath.PATH, "CustomMapApiBuilder"));
MogoModulePaths.addBaseModule(new MogoModule(ServiceConst.PATH_REFRESH_STRATEGY, ServiceConst.PATH_REFRESH_STRATEGY));
// MogoModulePaths.addBaseModule(new MogoModule(V2XConst.PATH_V2X_UI, V2XConst.MODULE_NAME));
// 域控制器模块(新)
MogoModulePaths.addModuleFunctionServer(new MogoModule(MogoServicePaths.PATH_AUTO_PILOT, "IMoGoAutoPilotProvider"));
// OBU 模块
MogoModulePaths.addModuleFunctionServer(new MogoModule(MogoServicePaths.PATH_V2X_OBU_MOGO, "IMoGoObuProvider"));
// 超视距,路测、行车记录仪监控
@@ -365,5 +134,6 @@ public abstract class MainMoGoApplication extends AbsMogoApplication {
AppLaunchTimeUtils.beginTimeCalculate(AppLaunchTimeUtils.COLD_START);
}
BoostMultiDex.install(base);
AbsMogoApplication.sApp = this;
}
}

View File

@@ -22,13 +22,13 @@ import com.mogo.eagle.core.function.main.constants.MainConstants;
* <p>
* 描述
*/
public class MainPresenter extends Presenter< MainView > {
public class MainPresenter extends Presenter<MainView> {
private Handler mMsgHandler = new Handler( Looper.getMainLooper() ) {
private Handler mMsgHandler = new Handler(Looper.getMainLooper()) {
@Override
public void handleMessage( Message msg ) {
super.handleMessage( msg );
switch ( msg.what ) {
public void handleMessage(Message msg) {
super.handleMessage(msg);
switch (msg.what) {
case MainConstants.MSG_HIDE_MAP_COVER_FRAME:
mView.hideCoverUpLayout();
break;
@@ -41,14 +41,14 @@ public class MainPresenter extends Presenter< MainView > {
public static final int MOGO_PERMISSION_REQUEST_CODE = 10000;
public MainPresenter( MainView view ) {
super( view );
SchemeIntent.getInstance().init( getContext(), mView.getApis() );
public MainPresenter(MainView view) {
super(view);
SchemeIntent.getInstance().init(getContext(), mView.getApis());
}
@Override
public void onCreate( @NonNull LifecycleOwner owner ) {
super.onCreate( owner );
public void onCreate(@NonNull LifecycleOwner owner) {
super.onCreate(owner);
}
public void checkPermission(Activity activity) {
@@ -96,25 +96,20 @@ public class MainPresenter extends Presenter< MainView > {
return true;
}
/**
* 延时操作
*/
public void delayOperations() {
mMsgHandler.sendEmptyMessageDelayed( MainConstants.MSG_HIDE_MAP_COVER_FRAME, 150L );
mMsgHandler.sendEmptyMessage(MainConstants.MSG_HIDE_MAP_COVER_FRAME);
}
public void postLoadModuleMsg() {
Message msg = Message.obtain();
msg.what = MainConstants.MSG_LOAD_MODULES;
mMsgHandler.sendMessageDelayed( msg, 500 );
mMsgHandler.sendMessage(msg);
}
public void handleSchemeIntent( Intent intent, boolean isOnNewIntent ) {
SchemeIntent.getInstance().handle( intent, isOnNewIntent );
}
public void initADAS(){
public void handleSchemeIntent(Intent intent, boolean isOnNewIntent) {
SchemeIntent.getInstance().handle(intent, isOnNewIntent);
}
}

View File

@@ -0,0 +1,33 @@
package com.mogo.eagle.core.function.main.stagetwo;
import android.content.Context;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.alibaba.android.arouter.launcher.ARouter;
import com.mogo.test.crashreport.CrashReportConstants;
import com.mogo.test.crashreport.upgrade.UpgradeReportConstants;
import com.rousetime.android_startup.AndroidStartup;
public class APMStartup extends AndroidStartup<Boolean> {
@Nullable
@Override
public Boolean create(@NonNull Context context) {
// bugly
ARouter.getInstance().build(UpgradeReportConstants.PATH).navigation();
// apm
ARouter.getInstance().build(CrashReportConstants.PATH).navigation();
return true;
}
@Override
public boolean callCreateOnMainThread() {
return true;
}
@Override
public boolean waitOnMainThread() {
return false;
}
}

View File

@@ -0,0 +1,40 @@
package com.mogo.eagle.core.function.main.stagetwo;
import android.content.Context;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.alibaba.android.arouter.launcher.ARouter;
import com.mogo.eagle.core.data.constants.MogoServicePaths;
import com.rousetime.android_startup.AndroidStartup;
import java.util.ArrayList;
import java.util.List;
public class AutopilotStartup extends AndroidStartup<Boolean> {
@Nullable
@Override
public Boolean create(@NonNull Context context) {
ARouter.getInstance().build(MogoServicePaths.PATH_AUTO_PILOT).navigation();
return true;
}
@Override
public boolean callCreateOnMainThread() {
return true;
}
@Override
public boolean waitOnMainThread() {
return false;
}
@Nullable
@Override
public List<String> dependenciesByName() {
List<String> deps = new ArrayList<>();
deps.add("com.mogo.eagle.core.function.main.stagetwo.APMStartup");
return deps;
}
}

View File

@@ -0,0 +1,38 @@
package com.mogo.eagle.core.function.main.stagetwo;
import android.content.Context;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.rousetime.android_startup.AndroidStartup;
import java.util.ArrayList;
import java.util.List;
public class MapStartup extends AndroidStartup<Boolean> {
@Nullable
@Override
public Boolean create(@NonNull Context context) {
// TODO:暂不支持分步加载
return true;
}
@Override
public boolean callCreateOnMainThread() {
return true;
}
@Override
public boolean waitOnMainThread() {
return false;
}
@Nullable
@Override
public List<String> dependenciesByName() {
List<String> deps = new ArrayList<>();
deps.add("com.mogo.eagle.core.function.main.stagetwo.APMStartup");
return deps;
}
}

View File

@@ -1,14 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape android:shape="rectangle">
<gradient android:angle="270"
android:endColor="#00044CFF"
android:startColor="#FF45D3FF"
android:type="radial"
android:centerX="0.5"
android:centerY="0"
android:gradientRadius="@dimen/dp_46"/>
</shape>
</item>
</selector>

View File

@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:id="@+id/background">
<shape
android:innerRadius="@dimen/dp_85"
android:shape="ring"
android:thickness="4px"
android:useLevel="false">
<solid android:color="#BBCFF6" />
</shape>
</item>
</layer-list>

View File

@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape android:shape="rectangle">
<corners android:radius="@dimen/dp_36"/>
<gradient android:angle="315" android:endColor="#E6E9EFFC" android:startColor="#E6E9EFFC" />
</shape>
</item>
</selector>

Binary file not shown.

After

Width:  |  Height:  |  Size: 130 KiB

View File

@@ -1,18 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape
android:innerRadiusRatio="3"
android:shape="ring"
android:thicknessRatio="8"
android:useLevel="false">
<gradient
android:centerColor="#FF7121"
android:centerY="0.50"
android:endColor="#FFFF00"
android:startColor="#6BD3FF"
android:type="sweep"
android:useLevel="false" />
</shape>
</item>
</layer-list>

View File

@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="48px"
android:padding="12px">
<TextView
android:id="@+id/tvStatusInfo"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
android:textSize="24px"
tools:text="测试数据看一下测试数据看一下测试数据看一下测试数据看一下测试数据看一下测试数据看一下测试数据看一下测试数据看一下测试数据看一下测试数据看一下"
/>
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -44,8 +44,6 @@
android:id="@+id/flVipIdentificationView"
android:layout_width="@dimen/module_vip_width"
android:layout_height="@dimen/module_vip_height"
android:layout_marginStart="@dimen/module_vip_margin_left"
android:layout_marginTop="@dimen/module_vip_margin_top"
android:visibility="gone"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent" />

View File

@@ -3,29 +3,17 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/bg_steering_wheel">
<ImageView
android:id="@+id/autopilot_iv"
android:layout_width="@dimen/dp_240"
android:layout_height="@dimen/dp_240"
android:layout_centerHorizontal="true"
android:layout_gravity="center_horizontal"
android:layout_marginTop="@dimen/dp_60"
android:src="@drawable/bg_auto"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
android:background="@drawable/bg_steering_wheel_bus">
<ProgressBar
android:id="@+id/blue_circle"
android:layout_width="@dimen/dp_260"
android:layout_height="@dimen/dp_260"
android:layout_width="@dimen/dp_180"
android:layout_height="@dimen/dp_180"
android:layout_centerHorizontal="true"
android:layout_marginLeft="@dimen/dp_85"
android:layout_marginTop="@dimen/dp_50"
android:layout_marginRight="@dimen/dp_85"
android:indeterminateDrawable="@drawable/bg_steering_outer"
android:layout_marginLeft="@dimen/dp_60"
android:layout_marginTop="@dimen/dp_38"
android:layout_marginRight="@dimen/dp_60"
android:indeterminateDrawable="@drawable/bg_steering_outer_bus"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
@@ -38,8 +26,8 @@
android:layout_marginRight="-10px"
android:gravity="right"
android:text="-18°"
android:textColor="#FFFFFFFF"
android:textSize="@dimen/dp_37"
android:textColor="#415479"
android:textSize="@dimen/dp_26"
android:visibility="invisible"
app:layout_constraintRight_toLeftOf="@+id/blue_circle"
app:layout_constraintTop_toTopOf="parent" />
@@ -52,25 +40,35 @@
android:layout_marginTop="@dimen/dp_50"
android:gravity="left"
android:text="18°"
android:textColor="#FFFFFFFF"
android:textSize="@dimen/dp_37"
android:textColor="#415479"
android:textSize="@dimen/dp_26"
app:layout_constraintLeft_toRightOf="@+id/autopilot_iv"
app:layout_constraintTop_toTopOf="parent" />
<com.mogo.eagle.core.function.hmi.ui.widget.CircularProgressView
android:id="@+id/steering_circular"
android:layout_width="@dimen/dp_260"
android:layout_height="@dimen/dp_260"
android:layout_width="@dimen/dp_180"
android:layout_height="@dimen/dp_180"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginTop="@dimen/dp_50"
android:outlineAmbientShadowColor="#1EBBCFF6"
android:layout_marginTop="@dimen/dp_36"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:progWidth="8px"
app:progress="0" />
<ImageView
android:id="@+id/autopilot_iv"
android:layout_width="@dimen/dp_186"
android:layout_height="@dimen/dp_186"
android:layout_centerHorizontal="true"
android:layout_gravity="center_horizontal"
android:layout_marginTop="@dimen/dp_34"
android:src="@drawable/bg_auto"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<ImageView
android:layout_width="@dimen/dp_40"
@@ -86,8 +84,7 @@
android:id="@+id/tap_position"
android:layout_width="@dimen/dp_240"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_30"
android:layout_marginBottom="@dimen/dp_40"
android:layout_marginBottom="@dimen/dp_20"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"

View File

@@ -0,0 +1,109 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="@dimen/dp_630"
android:layout_height="@dimen/dp_630"
android:background="@drawable/steering_bg">
<ImageView
android:id="@+id/autopilot_iv"
android:layout_width="@dimen/dp_240"
android:layout_height="@dimen/dp_240"
android:layout_centerHorizontal="true"
android:layout_gravity="center_horizontal"
android:layout_marginTop="@dimen/dp_140"
android:src="@drawable/bg_auto"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<!--底层默认进度条,无进度值改变动作-->
<ProgressBar
android:id="@+id/blue_circle"
android:layout_width="@dimen/dp_260"
android:layout_height="@dimen/dp_260"
android:layout_centerHorizontal="true"
android:layout_marginLeft="@dimen/dp_85"
android:layout_marginTop="@dimen/dp_130"
android:layout_marginRight="@dimen/dp_85"
android:indeterminateDrawable="@drawable/bg_steering_outer_taxi"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/steering_tv_left"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_130"
android:layout_marginRight="-10px"
android:gravity="right"
android:text="-18°"
android:textColor="#FFFFFFFF"
android:textSize="@dimen/dp_37"
android:visibility="invisible"
app:layout_constraintRight_toLeftOf="@+id/blue_circle"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/steering_tv_right"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="-10px"
android:layout_marginTop="@dimen/dp_130"
android:gravity="left"
android:text="18°"
android:textColor="#FFFFFFFF"
android:textSize="@dimen/dp_37"
app:layout_constraintLeft_toRightOf="@+id/autopilot_iv"
app:layout_constraintTop_toTopOf="parent" />
<!--进度值改变状态进度条-->
<com.mogo.eagle.core.function.hmi.ui.widget.CircularProgressView
android:id="@+id/steering_circular"
android:layout_width="@dimen/dp_260"
android:layout_height="@dimen/dp_260"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginTop="@dimen/dp_130"
android:outlineAmbientShadowColor="#1EBBCFF6"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:progWidth="8px"
app:progress="0" />
<!--状态条阴影-->
<com.mogo.eagle.core.function.hmi.ui.widget.CircularProgressView
android:id="@+id/steering_circular_alpha"
android:layout_width="@dimen/dp_274"
android:layout_height="@dimen/dp_274"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginTop="@dimen/dp_122"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:progWidth="22px"
app:progress="0" />
<ImageView
android:layout_width="@dimen/dp_60"
android:layout_height="@dimen/dp_60"
android:src="@drawable/icon_in_steering"
app:layout_constraintBottom_toBottomOf="@+id/autopilot_iv"
app:layout_constraintLeft_toLeftOf="@+id/autopilot_iv"
app:layout_constraintRight_toRightOf="@+id/autopilot_iv"
app:layout_constraintTop_toTopOf="@+id/autopilot_iv" />
<!--档位信息-->
<com.mogo.eagle.core.function.hmi.ui.widget.TapPositionView
android:id="@+id/tap_position"
android:layout_width="@dimen/dp_272"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_30"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@+id/blue_circle" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -0,0 +1,81 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
xmlns:app="http://schemas.android.com/apk/res-auto">
<TextView
android:id="@+id/tvReportTimeTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
/>
<TextView
android:id="@+id/tvReportTimeContent"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintLeft_toRightOf="@id/tvReportTimeTitle"
/>
<TextView
android:id="@+id/tvReportResultTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvReportTimeTitle"
/>
<TextView
android:id="@+id/tvReportResultContent"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintTop_toTopOf="@id/tvReportResultTitle"
app:layout_constraintLeft_toRightOf="@id/tvReportResultTitle"
android:minLines="1"
/>
<TextView
android:id="@+id/tvReportMsgTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintTop_toBottomOf="@id/tvReportResultContent"
app:layout_constraintLeft_toLeftOf="parent"
/>
<TextView
android:id="@+id/tvReportMsgContent"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintTop_toTopOf="@id/tvReportMsgTitle"
app:layout_constraintLeft_toRightOf="@id/tvReportMsgTitle"
android:minLines="1"
/>
<TextView
android:id="@+id/tvReportActionTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvReportMsgContent"
/>
<TextView
android:id="@+id/tvReportActionContent"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintTop_toTopOf="@id/tvReportActionTitle"
app:layout_constraintLeft_toRightOf="@id/tvReportActionTitle"
android:minLines="1"
/>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="#F0F0F0"
app:layout_constraintTop_toBottomOf="@id/tvReportActionContent"
/>
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -87,4 +87,10 @@
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rvConnectInfo"
android:layout_width="match_parent"
android:layout_height="match_parent"
/>
</FrameLayout>

View File

@@ -293,6 +293,17 @@
android:layout_height="1dp"
android:background="#F0F0F0" />
<TextView
android:id="@+id/tvIpcVersionInfo"
style="@style/DebugSettingText"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="#F0F0F0" />
<TextView
android:id="@+id/tvMoGoMapVersion"
style="@style/DebugSettingText"
@@ -468,7 +479,7 @@
style="@style/DebugSettingText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minLines="6"
android:minLines="7"
app:layout_constraintTop_toTopOf="parent" />
<View
@@ -528,61 +539,6 @@
android:background="#F0F0F0"
app:layout_constraintTop_toBottomOf="@id/btnSetAutopilotIP" />
<Button
android:id="@+id/btnSetAutopilotSpeed"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:padding="@dimen/dp_5"
android:text="设置最大速度"
android:textSize="@dimen/dp_24"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toBottomOf="@id/autopilotIPDivider" />
<androidx.appcompat.widget.LinearLayoutCompat
android:id="@+id/llSpeedLayout"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginStart="@dimen/dp_30"
android:layout_marginTop="@dimen/dp_10"
android:layout_marginEnd="@dimen/dp_30"
android:layout_marginBottom="@dimen/dp_10"
android:background="@drawable/debug_setting_edit_bg"
android:focusable="true"
android:focusableInTouchMode="true"
android:orientation="horizontal"
app:layout_constraintBottom_toBottomOf="@id/btnSetAutopilotSpeed"
app:layout_constraintLeft_toRightOf="@id/btnSetAutopilotSpeed"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="@id/btnSetAutopilotSpeed">
<androidx.appcompat.widget.AppCompatEditText
android:id="@+id/etInputSpeed"
style="@style/DebugSettingText"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_marginStart="90px"
android:layout_weight="1"
android:background="@null"
android:gravity="center"
tools:ignore="SpeakableTextPresentCheck" />
<TextView
style="@style/DebugSettingText"
android:layout_width="93px"
android:layout_height="match_parent"
android:gravity="center_vertical"
android:text="km/h" />
</androidx.appcompat.widget.LinearLayoutCompat>
<View
android:id="@+id/autopilotSpeedDivider"
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="#F0F0F0"
app:layout_constraintTop_toBottomOf="@id/btnSetAutopilotSpeed" />
<Button
android:id="@+id/btnRecordPackage"
android:layout_width="wrap_content"
@@ -592,7 +548,7 @@
android:text="录制Bag包"
android:textSize="@dimen/dp_24"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toBottomOf="@id/autopilotSpeedDivider" />
app:layout_constraintTop_toBottomOf="@id/autopilotIPDivider" />
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="0dp"
@@ -636,36 +592,13 @@
android:layout_height="1dp"
android:background="#F0F0F0"
app:layout_constraintTop_toBottomOf="@id/btnRecordPackage" />
<Button
android:id="@+id/btnSystemUpgrade"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="升级系统"
android:visibility="gone"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toLeftOf="@id/btnSystemRestart"
app:layout_constraintTop_toBottomOf="@id/recordPackageDivider"
tools:visibility="visible" />
<Button
android:id="@+id/btnSystemRestart"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="重启系统"
android:visibility="gone"
app:layout_constraintLeft_toRightOf="@id/btnSystemUpgrade"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@id/recordPackageDivider"
tools:visibility="visible" />
<TextView
android:id="@+id/tvCarInfo"
style="@style/DebugSettingText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintTop_toBottomOf="@id/btnSystemUpgrade" />
app:layout_constraintTop_toBottomOf="@id/recordPackageDivider" />
<TextView
android:id="@+id/tvIdentifyInfo"

View File

@@ -0,0 +1,29 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="840px"
android:layout_height="584px"
android:orientation="vertical">
<ImageView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:src="@drawable/icon_drag"
android:padding="15dp"
android:layout_gravity="center_horizontal"
/>
<com.mogo.eagle.core.widget.RoundConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/dialog_bg_color"
app:roundLayoutRadius="10dp">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv_ipc_report"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
</com.mogo.eagle.core.widget.RoundConstraintLayout>
</LinearLayout>

View File

@@ -57,4 +57,5 @@
<color name="hmi_light_blue">#45D3FF</color>
<color name="hmi_dark_blue">#1B5BFF</color>
<color name="hmi_light_blue_00">#0045D3FF</color>
<color name="hmi_light_blue_alpha">#666C79C4</color>
</resources>

View File

@@ -37,7 +37,7 @@
<string name="application_upgrade_confirm">是否将应用升级至最新版本?</string>
<string name="application_upgrade_tips">注意!升级时需退出自动驾驶,支持在人工驾驶时升级,升级时不可中途断电。</string>
<string name="confirm">确认</string>
<string name="cancel">取消</string>
<string name="cancel">稍后升级</string>
<!--绑定车机-->
<string name="bindingcar_title">绑定车机</string>

View File

@@ -9,6 +9,7 @@ import com.mogo.eagle.core.function.call.trafficlight.CallTrafficLightManager
import com.mogo.eagle.core.function.v2x.events.V2XEventManager
import com.mogo.eagle.core.function.v2x.redlightwarning.RedLightWarningManager
import com.mogo.eagle.core.function.v2x.speedlimit.SpeedLimitDataManager
import com.mogo.eagle.core.function.v2x.trafficlight.core.TrafficLightDispatcher
import com.mogo.eagle.core.function.v2x.vip.VipCarManager
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
@@ -22,6 +23,7 @@ class V2XProvider : IMoGoFunctionServerProvider {
CallTrafficLightManager.getTrafficLightProvider().initTrafficLightServer(context)
VipCarManager.INSTANCE.initServer(context)
SpeedLimitDataManager.getInstance().start()
TrafficLightDispatcher.INSTANCE.initServer(context)
if (AppIdentityModeUtils.isBus(FunctionBuildConfig.appIdentityMode) && AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode)) {
//不处理
@@ -34,7 +36,7 @@ class V2XProvider : IMoGoFunctionServerProvider {
override fun onDestroy() {
VipCarManager.INSTANCE.destroy()
TrafficLightDispatcher.INSTANCE.destroy()
if (AppIdentityModeUtils.isBus(FunctionBuildConfig.appIdentityMode) && AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode)) {
//不处理
} else {

View File

@@ -0,0 +1,112 @@
package com.mogo.eagle.core.function.v2x.trafficlight.core
import android.content.Context
import com.mogo.eagle.core.data.trafficlight.TrafficLightResult
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotIdentifyListener
import com.mogo.eagle.core.function.api.trafficlight.IMoGoTrafficLightListener
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotIdentifyListenerManager
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager
import com.mogo.eagle.core.function.call.trafficlight.CallTrafficLightListenerManager
import com.mogo.eagle.core.function.v2x.trafficlight.TrafficLightHMIManager
import perception.TrafficLightOuterClass
import perception.TrafficLightOuterClass.TrafficLight
/**
* @author XuXinChao
* @description 对多个红绿灯信号来源进行统一调度AI云、工控机
* @since: 2022/4/28
*/
class TrafficLightDispatcher : IMoGoAutopilotIdentifyListener , IMoGoTrafficLightListener {
companion object{
const val TAG = "TrafficLightDispatcher"
val INSTANCE: TrafficLightDispatcher by lazy(mode = LazyThreadSafetyMode.SYNCHRONIZED){
TrafficLightDispatcher()
}
}
private var mContext: Context? = null
//是否有AI获取红绿灯灯态
private var hasAiLightStatus: Boolean = false
fun initServer(context: Context){
mContext = context
//注册监听AI云获取红绿灯状态
CallTrafficLightListenerManager.registerTrafficLightListener(TAG, this)
//注册监听AI云进入路口
CallTrafficLightListenerManager.registerEnterCrossRoadListener(TAG, this)
//注册监听工控机感知红绿灯
CallerAutopilotIdentifyListenerManager.addListener(TAG, this)
}
/**
* 工控机感知红绿灯
* @param trafficLights 感知红绿灯
*/
override fun onAutopilotPerceptionTrafficLight(trafficLights: TrafficLightOuterClass.TrafficLights?) {
if(!hasAiLightStatus){
trafficLights?.let { it ->
var light :TrafficLight?= null
if(it.hasStraight()){
light = it.straight
}else if(it.hasLeft()){
light = it.left
}else if(it.hasRight()){
light = it.right
}else if(it.hasUTurn()){
light = it.uTurn
}
if(light == null){
//隐藏红绿灯显示
CallerHmiManager.showWarningTrafficLight(0)
}else{
when (light.state) {
TrafficLightOuterClass.LightState.STATE_RED -> {
//红灯
CallerHmiManager.showWarningTrafficLight(1)
CallerHmiManager.changeCountdownGreen(0)
}
TrafficLightOuterClass.LightState.STATE_YELLOW -> {
//黄灯
CallerHmiManager.showWarningTrafficLight(2)
CallerHmiManager.changeCountdownGreen(0)
}
TrafficLightOuterClass.LightState.STATE_GREEN -> {
//绿灯
CallerHmiManager.showWarningTrafficLight(3)
CallerHmiManager.changeCountdownGreen(0)
}
else -> {}
}
}
}
}
}
/**
* AI云获取红绿灯状态
*/
override fun onTrafficLightStatus(trafficLightResult: TrafficLightResult) {
TrafficLightHMIManager.INSTANCE.updateTrafficLight(trafficLightResult)
hasAiLightStatus = true
}
/**
* 车辆进入路口
*/
override fun onEnterCrossRoad(enter: Boolean) {
hasAiLightStatus = enter
}
fun destroy(){
//取消注册监听AI云获取红绿灯状态
CallTrafficLightListenerManager.unRegisterTrafficLightListener(TAG)
//取消注册监听工控机感知红绿灯
CallerAutopilotIdentifyListenerManager.removeListener(TAG)
//取消注册监听AI云进入路口
CallTrafficLightListenerManager.unRegisterEnterCrossRoadListener(TAG)
}
}

View File

@@ -74,5 +74,11 @@ class AutopilotStatusInfo : Serializable {
*/
var pilotmode = 0
override fun toString(): String {
return "AutopilotStatusInfo(connectIP=$connectIP, connectPort=$connectPort, " +
"connectStatus=$connectStatus, connectDescribe=$connectStatusDescribe, version=$version, dockVersion=$dockVersion," +
" locationStatus=$locationStatus), locationLat=$locationLat, locationLon=$locationLon," +
" satelliteTime=$satelliteTime, speed=$speed, state=$state, reason=$reason, camera=$camera," +
" radar=$radar, rtk=$rtk, pilotmode=$pilotmode)"
}
}

View File

@@ -0,0 +1,26 @@
package com.mogo.eagle.core.data.bindingcar
/**
* @author XuXinChao
* @description 工控机镜像升级状态实体类
* @since: 2022/5/12
*/
data class IPCUpgradeStateInfo(
val callback_url: String,
val images: List<String>,
val progress: Progress,
val release_id: String,
val status: String,
val token: String
)
data class Progress(
val id: String,
val progressDetail: ProgressDetail,
val status: String
)
data class ProgressDetail(
val current: Int,
val total: Int
)

View File

@@ -19,7 +19,7 @@ class ChainConstant {
const val CHAIN_LINK_LOG_ADAS_TRAJECTORY = "-adasWsTrajectory"
const val CHAIN_LINK_LOG_ADAS_VEHICLE = "-adasWsVehicle"
const val CHAIN_ALIAS_CODE_MULTI_CONNECT = "CHAIN_ALIAS_CODE_MULTI_CONNECT"
const val CHAIN_ALIAS_CODE_ADAS_MESSAGE_RECT_DATA = "PAD_ADAS_MESSAGE_AUTOPILOT_RECT_DATA"
const val CHAIN_ALIAS_CODE_ADAS_MESSAGE_CAR_STATE = "PAD_ADAS_MESSAGE_AUTOPILOT_CAR_STATE"
const val CHAIN_ALIAS_CODE_ADAS_MESSAGE_AUTOPILOT_STATUS = "PAD_ADAS_MESSAGE_AUTOPILOT_STATUS"
@@ -30,5 +30,12 @@ class ChainConstant {
const val CHAIN_ALIAS_CODE_ADAS_MESSAGE_AUTOPILOT_RECORD = "PAD_ADAS_MESSAGE_AUTOPILOT_RECORD"
const val CHAIN_ALIAS_CODE_ADAS_MESSAGE_AUTOPILOT_VEHICLE = "PAD_ADAS_MESSAGE_AUTOPILOT_VEHICLE"
const val CHAIN_ALIAS_CODE_ADAS_MESSAGE_AUTOPILOT_WARN = "PAD_ADAS_MESSAGE_AUTOPILOT_WARN"
//operation by user
const val CHAIN_ALIAS_CODE_OCH_BUS_START_AUTOPILOT = "CHAIN_ALIAS_CODE_OCH_BUS_START_AUTOPILOT"
const val CHAIN_ALIAS_CODE_OCH_TAXI_START_AUTOPILOT = "CHAIN_ALIAS_CODE_OCH_TAXI_START_AUTOPILOT"
const val CHAIN_ALIAS_CODE_EAGLE_START_AUTOPILOT = "CHAIN_ALIAS_CODE_EAGLE_START_AUTOPILOT"
const val CHAIN_ALIAS_CODE_EAGLE_START_AUTOPILOT_RESULT = "CHAIN_ALIAS_CODE_EAGLE_START_AUTOPILOT_RESULT"
}
}

View File

@@ -1,6 +1,7 @@
package com.mogo.eagle.core.function.api.autopilot
import mogo.telematics.pad.MessagePad
import perception.TrafficLightOuterClass
/**
* @author xiaoyuzhou
@@ -23,4 +24,10 @@ interface IMoGoAutopilotIdentifyListener {
*/
fun onAutopilotWarnMessage(warn: MessagePad.Warn?) {}
/**
* 感知红绿灯
* @param trafficLights 感知红绿灯
*/
fun onAutopilotPerceptionTrafficLight(trafficLights: TrafficLightOuterClass.TrafficLights?){}
}

View File

@@ -2,17 +2,12 @@ package com.mogo.eagle.core.function.api.check;
import android.content.Context;
import com.alibaba.android.arouter.facade.template.IProvider;
import org.jetbrains.annotations.NotNull;
import kotlin.Unit;
import kotlin.jvm.functions.Function0;
import com.mogo.eagle.core.function.api.base.IMoGoFunctionServerProvider;
/**
* 检测接口
*/
public interface ICheckProvider extends IProvider {
public interface ICheckProvider extends IMoGoFunctionServerProvider {
/**
* 注册车辆监控变化监听
*

View File

@@ -27,6 +27,11 @@ interface IMoGoDevaToolsListener {
*/
fun onLogCatch(lineLog: String)
/**
* fw线程写入倒计时结束
*/
fun fwThreadClose()
/**
* 模块TAG更新回调
*/

View File

@@ -4,6 +4,7 @@ import android.view.View
import com.mogo.eagle.core.data.enums.WarningDirectionEnum
import com.mogo.eagle.core.data.notice.NoticeNormalData
import com.mogo.eagle.core.data.notice.NoticeTrafficStylePushData
import com.mogo.eagle.core.data.report.ReportEntity
import com.mogo.eagle.core.function.api.hmi.IMoGoHmiViewProxy
/**
@@ -203,17 +204,6 @@ interface IMoGoWaringProvider : IMoGoHmiViewProxy {
*/
fun showModifyBindingcarDialog()
/**
* 展示工控机下载、升级状态信息
* @param upgradeMode 升级模式(提示升级、静默升级)
* @param downloadStatus 下载状态
* @param currentProgress 当前已经下载包体大小
* @param totalProgress 下载包体总大小
* @param downloadVersion 下载版本
* @param upgradeStatus 升级状态
*/
fun showAdUpgradeStatus(upgradeMode: Int, downloadStatus: Int, currentProgress: Int, totalProgress: Int, downloadVersion: String, upgradeStatus: Int)
/**
*注册工控机升级提示圆点View的回调
* @param 提示圆点View
@@ -226,4 +216,10 @@ interface IMoGoWaringProvider : IMoGoHmiViewProxy {
* @param msg
*/
fun showDockerRebootResult(code: Int,msg: String)
/**
* 展示工控机监控上报数据
* @param reportList 上报数据列表
*/
fun showIPCReportWindow(reportList: ArrayList<ReportEntity>)
}

View File

@@ -0,0 +1,9 @@
package com.mogo.eagle.core.function.api.map.deva
interface IMoGoMapDevaProvider {
/**
* 压缩并上传地图日志
*/
fun uploadFile(filePath: String)
}

View File

@@ -3,9 +3,15 @@ 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.deva.chain.ChainConstant
import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_ALIAS_CODE_EAGLE_START_AUTOPILOT
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_AUTOPILOT
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 com.zhjt.service.chain.ChainLog
import com.zhjt.service.chain.TracingConstants
import kotlin.random.Random
/**
@@ -43,6 +49,14 @@ object CallerAutoPilotManager {
*
* @param controlParameters 开启自动驾驶的控制参数
*/
@ChainLog(
linkChainLog = CHAIN_LINK_LOG_WEB_SOCKET_AUTOPILOT,
linkCode = CHAIN_LINK_ADAS,
endpoint = TracingConstants.Endpoint.PAD,
nodeAliasCode = CHAIN_ALIAS_CODE_EAGLE_START_AUTOPILOT,
paramIndexes = [0],
clientPkFileName = "sn"
)
fun startAutoPilot(controlParameters: AutopilotControlParameters?) {
if (controlParameters == null) {
//LogUtils.eTag(TAG, "自动驾驶控制参数异常,请检查参数信息")

View File

@@ -4,6 +4,7 @@ import androidx.annotation.Nullable
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotIdentifyListener
import com.mogo.eagle.core.function.call.base.CallerBase
import mogo.telematics.pad.MessagePad
import perception.TrafficLightOuterClass
import java.util.concurrent.ConcurrentHashMap
/**
@@ -79,5 +80,15 @@ object CallerAutopilotIdentifyListenerManager : CallerBase() {
}
}
/**
* 感知红绿灯
*/
fun invokeAutopilotPerceptionTrafficLight(trafficLights: TrafficLightOuterClass.TrafficLights?){
M_AUTOPILOT_IDENTIFY_LISTENERS.forEach{
val tag = it.key
val listener = it.value
listener.onAutopilotPerceptionTrafficLight(trafficLights)
}
}
}

View File

@@ -72,6 +72,13 @@ object CallerDevaToolsListenerManager {
}
}
fun invokeDevaToolsFwThreadClose() {
M_DEVA_TOOLS_LISTENER.forEach {
val listener = it.value
listener.fwThreadClose()
}
}
fun invokeDevaToolsModuleLogChanges(moduleTag: MutableMap<String, SceneModule>) {
M_DEVA_TOOLS_LISTENER.forEach {
val listener = it.value

View File

@@ -6,6 +6,7 @@ import com.mogo.eagle.core.data.constants.MoGoFragmentPaths
import com.mogo.eagle.core.data.enums.WarningDirectionEnum
import com.mogo.eagle.core.data.notice.NoticeNormalData
import com.mogo.eagle.core.data.notice.NoticeTrafficStylePushData
import com.mogo.eagle.core.data.report.ReportEntity
import com.mogo.eagle.core.function.api.hmi.view.IViewLimitingVelocity
import com.mogo.eagle.core.function.api.hmi.view.IViewNotification
import com.mogo.eagle.core.function.api.hmi.view.IViewTrafficLight
@@ -279,20 +280,6 @@ object CallerHmiManager : CallerBase() {
waringProviderApi?.hideToolsView()
}
/**
* 展示工控机下载、升级状态信息
* @param upgradeMode 升级模式(提示升级、静默升级)
* @param downloadStatus 下载状态
* @param currentProgress 当前已经下载包体大小
* @param totalProgress 下载包体总大小
* @param downloadVersion 下载版本
* @param upgradeStatus 升级状态
*/
fun showAdUpgradeStatus(upgradeMode : Int, downloadStatus : Int,currentProgress : Int,totalProgress : Int
,downloadVersion : String,upgradeStatus : Int){
waringProviderApi?.showAdUpgradeStatus(upgradeMode,downloadStatus, currentProgress, totalProgress, downloadVersion, upgradeStatus)
}
/**
*注册工控机升级提示圆点View的回调
* @param 提示圆点View
@@ -334,4 +321,12 @@ object CallerHmiManager : CallerBase() {
waringProviderApi?.setProxyNotificationView(view)
}
/**
* 展示工控机监控上报数据
* @param reportList 上报数据列表
*/
fun showIPCReportWindow(reportList: ArrayList<ReportEntity>){
waringProviderApi?.showIPCReportWindow(reportList)
}
}

View File

@@ -0,0 +1,54 @@
package com.mogo.eagle.core.function.call.map
import androidx.annotation.Nullable
import com.mogo.eagle.core.function.api.map.deva.IMoGoMapDevaProvider
import com.mogo.eagle.core.function.call.base.CallerBase
import java.util.concurrent.ConcurrentHashMap
object CallerMapDevaListenerManager : CallerBase() {
private val mMapDevaListeners: ConcurrentHashMap<String, IMoGoMapDevaProvider> =
ConcurrentHashMap()
private var filePath: String? = null
fun addListener(
@Nullable tag: String,
@Nullable listener: IMoGoMapDevaProvider
) {
if (mMapDevaListeners.containsKey(tag)) {
return
}
mMapDevaListeners[tag] = listener
filePath?.let {
listener.uploadFile(it)
}
}
fun removeListener(@Nullable tag: String) {
if (!mMapDevaListeners.containsKey(tag)) {
return
}
mMapDevaListeners.remove(tag)
}
fun removeListener(@Nullable listener: IMoGoMapDevaProvider) {
if (!mMapDevaListeners.containsValue(listener)) {
return
}
mMapDevaListeners.forEach {
if (it.value == listener) {
mMapDevaListeners.remove(it.key)
}
}
}
fun invokeUploadLogFile(filePath: String) {
this.filePath = filePath
mMapDevaListeners.forEach {
val listener = it.value
listener.uploadFile(filePath)
}
}
}

View File

@@ -6,8 +6,11 @@
<dimen name="module_vip_width">104px</dimen>
<dimen name="module_vip_height">104px</dimen>
<dimen name="module_vip_margin_left">540px</dimen>
<dimen name="module_vip_margin_top">40px</dimen>
<dimen name="module_vip_margin_left_bus">540px</dimen>
<dimen name="module_vip_margin_top_bus">40px</dimen>
<dimen name="module_vip_margin_left_taxi">640px</dimen>
<dimen name="module_vip_margin_top_taxi">80px</dimen>
<dimen name="module_ext_speed_width_sm_radius">30px</dimen>
<dimen name="module_ext_speed_width_big_radius">130px</dimen>

View File

@@ -14,8 +14,11 @@
<dimen name="module_vip_width">104px</dimen>
<dimen name="module_vip_height">104px</dimen>
<dimen name="module_vip_margin_left">380px</dimen>
<dimen name="module_vip_margin_top">40px</dimen>
<dimen name="module_vip_margin_left_bus">380px</dimen>
<dimen name="module_vip_margin_top_bus">40px</dimen>
<dimen name="module_vip_margin_left_taxi">380px</dimen>
<dimen name="module_vip_margin_top_taxi">40px</dimen>
<dimen name="module_ext_speed_width_sm_radius">20px</dimen>
<dimen name="module_ext_speed_width_big_radius">110px</dimen>

View File

@@ -75,6 +75,8 @@ dependencies {
api rootProject.ext.dependencies.androidxlifecycleprocess
api rootProject.ext.dependencies.androidxccorektx
api rootProject.ext.dependencies.life_cycle_java8
api rootProject.ext.dependencies.mogochainbase
}
apply from: new File(rootProject.rootDir, "gradle/upload.gradle").toString()