Merge branch 'dev_robotaxi-d-app-module_270_220510_2.7.0' of gitlab.zhidaoauto.com:zhjt/AndroidApp/MoGoEagleEye into dev_robotaxi-d-app-module_270_220510_2.7.0
This commit is contained in:
@@ -1,5 +1,9 @@
|
||||
package com.mogo.och.bus.model;
|
||||
|
||||
import static com.mogo.eagle.core.data.deva.chain.ChainConstant.CHAIN_ALIAS_CODE_ADAS_MESSAGE_CAR_STATE;
|
||||
import static com.mogo.eagle.core.data.deva.chain.ChainConstant.CHAIN_ALIAS_CODE_OCH_BUS_START_AUTOPILOT;
|
||||
import static com.mogo.eagle.core.data.deva.chain.ChainConstant.CHAIN_LINK_ADAS;
|
||||
import static com.mogo.eagle.core.data.deva.chain.ChainConstant.CHAIN_LINK_LOG_WEB_SOCKET_AUTOPILOT;
|
||||
import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_BUS;
|
||||
import static com.mogo.och.bus.constant.BusConst.STATION_STATUS_STOPPED;
|
||||
|
||||
@@ -50,6 +54,8 @@ import com.mogo.och.common.module.utils.CoordinateCalculateRouteUtil;
|
||||
import com.mogo.och.common.module.utils.PinYinUtil;
|
||||
import com.mogo.service.statusmanager.IMogoStatusChangedListener;
|
||||
import com.mogo.service.statusmanager.StatusDescriptor;
|
||||
import com.zhjt.service.chain.ChainLog;
|
||||
import com.zhjt.service.chain.TracingConstants;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
@@ -465,6 +471,14 @@ public class BusOrderModel {
|
||||
* 服务端返回的OchBusRoutesResult逻辑, 离开站为当前站, 到达下一站后才会将下一站置为当前站,
|
||||
* 车机端展示是离开当前站,下一站设置为当前站, 所以服务端数据回来要做处理,不能直接渲染
|
||||
*/
|
||||
@ChainLog(
|
||||
linkChainLog = CHAIN_LINK_LOG_WEB_SOCKET_AUTOPILOT,
|
||||
linkCode = CHAIN_LINK_ADAS,
|
||||
endpoint = TracingConstants.Endpoint.PAD,
|
||||
nodeAliasCode = CHAIN_ALIAS_CODE_OCH_BUS_START_AUTOPILOT,
|
||||
paramIndexes = {0},
|
||||
clientPkFileName = "sn"
|
||||
)
|
||||
private void RenderLeaveStationSuccess(BusRoutesResult result, boolean isRestart) {
|
||||
renderBusStationsStatus(result);
|
||||
if (slidePannelHideCallback != null) {
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
package com.mogo.och.taxi.model;
|
||||
|
||||
import static com.mogo.eagle.core.data.deva.chain.ChainConstant.CHAIN_ALIAS_CODE_OCH_BUS_START_AUTOPILOT;
|
||||
import static com.mogo.eagle.core.data.deva.chain.ChainConstant.CHAIN_ALIAS_CODE_OCH_TAXI_START_AUTOPILOT;
|
||||
import static com.mogo.eagle.core.data.deva.chain.ChainConstant.CHAIN_LINK_ADAS;
|
||||
import static com.mogo.eagle.core.data.deva.chain.ChainConstant.CHAIN_LINK_LOG_WEB_SOCKET_AUTOPILOT;
|
||||
import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_TAXI;
|
||||
|
||||
import android.content.Context;
|
||||
@@ -60,6 +64,8 @@ import com.mogo.aicloud.services.socket.IMogoLifecycleListener;
|
||||
import com.mogo.service.intent.IMogoIntentListener;
|
||||
import com.mogo.service.statusmanager.IMogoStatusChangedListener;
|
||||
import com.mogo.service.statusmanager.StatusDescriptor;
|
||||
import com.zhjt.service.chain.ChainLog;
|
||||
import com.zhjt.service.chain.TracingConstants;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
@@ -778,6 +784,14 @@ public class TaxiModel {
|
||||
}
|
||||
|
||||
//以当前订单为基础,开启自动驾驶
|
||||
@ChainLog(
|
||||
linkChainLog = CHAIN_LINK_LOG_WEB_SOCKET_AUTOPILOT,
|
||||
linkCode = CHAIN_LINK_ADAS,
|
||||
endpoint = TracingConstants.Endpoint.PAD,
|
||||
nodeAliasCode = CHAIN_ALIAS_CODE_OCH_TAXI_START_AUTOPILOT,
|
||||
paramIndexes = {0},
|
||||
clientPkFileName = "sn"
|
||||
)
|
||||
public void startAutoPilot() {
|
||||
if (!checkCurrentOCHOrder()) {
|
||||
CallerLogger.INSTANCE.e(M_TAXI + TAG, "no order or order is empty.");
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.mogo.launcher.stageone
|
||||
|
||||
import android.content.Context
|
||||
import com.mogo.commons.debug.DebugConfig
|
||||
import com.mogo.eagle.core.data.app.AppConfigInfo.appBuildTime
|
||||
import com.mogo.eagle.core.data.app.AppConfigInfo.workingBranchHash
|
||||
import com.mogo.eagle.core.data.app.AppConfigInfo.workingBranchName
|
||||
import com.mogo.eagle.core.data.constants.MoGoConfig
|
||||
@@ -31,6 +32,7 @@ class ConfigStartUp : AndroidStartup<Boolean>() {
|
||||
// 初始化构建APP的时候的分支及提交HASH,用于辅助定位问题
|
||||
workingBranchName = BuildConfig.WORKING_BRANCH_NAME
|
||||
workingBranchHash = BuildConfig.WORKING_BRANCH_HASH
|
||||
appBuildTime = BuildConfig.APP_BUILD_TIME
|
||||
// 使用与渠道配置一样的gps提供者提供的数据,app/productFlavors/fPadLenovo.gradle GPS_PROVIDER 0-Android系统,1-工控机,2-OBU
|
||||
FunctionBuildConfig.gpsProvider = BuildConfig.GPS_PROVIDER
|
||||
// 演示模式,上一次勾选的数据
|
||||
|
||||
@@ -266,6 +266,40 @@ public class MainActivity extends BaseActivity implements OnAdasListener, OnAdas
|
||||
disconnect.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
// MessagePad.Header header = MessagePad.Header.newBuilder()
|
||||
// .setTimestamp(1.6523361438761907E9).build();
|
||||
// PointCloud.LidarPointCloud pointCloud = PointCloud.LidarPointCloud.newBuilder()
|
||||
// .setSelfLongitude(112.57563687979261)
|
||||
// .setSelfLatitude(26.828128487326854)
|
||||
// .setSelfAltitude(52.89)
|
||||
// .setSelfRoll(-0.00715584993317675)
|
||||
// .setSelfPitch(0.008726646259971651)
|
||||
// .setSelfYaw(0.4850269854068756)
|
||||
//
|
||||
// .addAddData(1F)
|
||||
// .addAddData(2F)
|
||||
// .addAddData(3F)
|
||||
// .addAddData(4F)
|
||||
// .addAddData(5F)
|
||||
// .addAddData(6F)
|
||||
// .addAddData(7F)
|
||||
// .addAddData(8F)
|
||||
//
|
||||
// .addDelData(9F)
|
||||
// .addDelData(10F)
|
||||
// .addDelData(11F)
|
||||
// .addDelData(12F)
|
||||
// .addDelData(13F)
|
||||
// .addDelData(14F)
|
||||
// .addDelData(15F)
|
||||
// .addDelData(16F)
|
||||
// .addDelData(17F)
|
||||
// .addDelData(18F)
|
||||
// .addDelData(19F)
|
||||
// .addDelData(20F)
|
||||
// .build();
|
||||
// String data = PointCloudDecoder.decode(header, pointCloud);
|
||||
// Log.i("ddd", "转换数据=" + data);
|
||||
connect(false);
|
||||
}
|
||||
});
|
||||
@@ -814,6 +848,9 @@ public class MainActivity extends BaseActivity implements OnAdasListener, OnAdas
|
||||
public void onPointCloud(MessagePad.Header header, PointCloud.LidarPointCloud pointCloud) {
|
||||
MyPointCloud base = new MyPointCloud(header, pointCloud);
|
||||
DataDistribution.getInstance().addData(base);
|
||||
// String data = PointCloudDecoder.decode(header, pointCloud);
|
||||
// Log.i("dddd", "data==" + data.length());
|
||||
// LogSave.getInstance().saveLog("转换数据=" + data);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
}
|
||||
@@ -25,6 +25,7 @@ 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
|
||||
@@ -224,7 +225,11 @@ class MoGoAdasListenerImpl : OnAdasListener {
|
||||
header: MessagePad.Header?,
|
||||
trafficLights: TrafficLightOuterClass.TrafficLights?
|
||||
) {
|
||||
|
||||
if(trafficLights != null){
|
||||
CallerAutopilotIdentifyListenerManager.invokeAutopilotPerceptionTrafficLight(
|
||||
trafficLights
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
override fun onPredictionObstacleTrajectory(
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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()
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
@@ -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){
|
||||
|
||||
@@ -73,7 +73,6 @@ 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
|
||||
|
||||
@@ -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
|
||||
*/
|
||||
|
||||
@@ -53,9 +53,11 @@ 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
|
||||
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
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_HMI
|
||||
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.*
|
||||
@@ -63,6 +65,7 @@ import com.mogo.map.MogoMap
|
||||
import com.mogo.map.uicontroller.VisualAngleMode
|
||||
import com.mogo.map.uicontroller.VisualAngleMode.*
|
||||
import com.zhidao.easysocket.utils.L
|
||||
import com.zhjt.mogo_core_function_devatools.trace.TraceManager
|
||||
import kotlinx.android.synthetic.main.view_debug_setting.view.*
|
||||
import mogo.telematics.pad.MessagePad
|
||||
import mogo_msg.MogoReportMsg
|
||||
@@ -83,8 +86,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 +97,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
|
||||
@@ -134,9 +137,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 +185,7 @@ class DebugSettingView @JvmOverloads constructor(
|
||||
// 添加 工控机基础信息回调 监听
|
||||
CallerAutopilotCarConfigListenerManager.addListener(TAG, this)
|
||||
//添加 车辆底盘数据回调 监听
|
||||
CallerAutopilotVehicleStateListenerManager.addListener(TAG,this)
|
||||
CallerAutopilotVehicleStateListenerManager.addListener(TAG, this)
|
||||
if (logInfoView != null) {
|
||||
logInfoView!!.onEnterForeground()
|
||||
}
|
||||
@@ -292,11 +295,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 +341,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 +401,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 +601,7 @@ class DebugSettingView @JvmOverloads constructor(
|
||||
}
|
||||
|
||||
//初始化切换自车按钮文本(Bus版本默认显示:切换自车为出租车)
|
||||
if(AppIdentityModeUtils.isBus(FunctionBuildConfig.appIdentityMode)){
|
||||
if (AppIdentityModeUtils.isBus(FunctionBuildConfig.appIdentityMode)) {
|
||||
tbChangeCurrentCarIcon.isChecked = true
|
||||
}
|
||||
|
||||
@@ -615,27 +618,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("判定刹车加速度阈值格式设置不正确")
|
||||
}
|
||||
}
|
||||
@@ -732,113 +736,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("域控制器未连接")
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -857,27 +754,6 @@ class DebugSettingView @JvmOverloads constructor(
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置工控机下载、升级状态信息
|
||||
* @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
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置Hmi点击监听
|
||||
@@ -976,13 +852,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 +868,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 +1074,10 @@ class DebugSettingView @JvmOverloads constructor(
|
||||
}
|
||||
}
|
||||
|
||||
override fun fwThreadClose() {
|
||||
refreshTraceInfo()
|
||||
}
|
||||
|
||||
override fun moduleLogChanged(moduleTag: MutableMap<String, SceneModule>) {
|
||||
//模块日志 tag 发生变化,需要更新对应 UI
|
||||
setLogCheckedChangeListener()
|
||||
@@ -1207,12 +1087,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 +1126,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 +1182,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 +1231,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 +1261,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)
|
||||
}
|
||||
}
|
||||
@@ -1435,7 +1326,8 @@ class DebugSettingView @JvmOverloads constructor(
|
||||
AppConfigInfo.isConnectedNetty = CallerTelematicManager.getClientConnStatus()
|
||||
AppConfigInfo.serverIp = CallerTelematicManager.getServerIp()
|
||||
}
|
||||
else -> {}
|
||||
else -> {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1453,9 +1345,9 @@ 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}"
|
||||
}
|
||||
tvMoGoMapVersion.text = "HD-Map版本:${MogoMap.getInstance().mogoMap.mapVersion}"
|
||||
@@ -1517,9 +1409,9 @@ class DebugSettingView @JvmOverloads constructor(
|
||||
"<font color='blue'>正常"
|
||||
} else {
|
||||
"<font color='red'>异常 原因:${
|
||||
if(AppConfigInfo.connectStatusDescribe.isNullOrEmpty()){
|
||||
if (AppConfigInfo.connectStatusDescribe.isNullOrEmpty()) {
|
||||
"主动断开连接"
|
||||
}else{
|
||||
} else {
|
||||
AppConfigInfo.connectStatusDescribe
|
||||
}
|
||||
}"
|
||||
@@ -1562,7 +1454,7 @@ class DebugSettingView @JvmOverloads constructor(
|
||||
)
|
||||
|
||||
tvLocationEnabled.text = Html.fromHtml(
|
||||
"定位服务开启状态:${
|
||||
"Pad定位服务开启状态:${
|
||||
if (DeviceUtils.isLocationEnabled()) {
|
||||
"<font color='blue'>正常"
|
||||
} else {
|
||||
@@ -1634,17 +1526,35 @@ class DebugSettingView @JvmOverloads constructor(
|
||||
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)
|
||||
@@ -1703,13 +1613,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
|
||||
|
||||
@@ -1749,7 +1661,7 @@ class DebugSettingView @JvmOverloads constructor(
|
||||
* 时延显示
|
||||
*/
|
||||
override fun onObuV2iDelayTime(delayTime: Long) {
|
||||
ThreadUtils.runOnUiThread{
|
||||
ThreadUtils.runOnUiThread {
|
||||
tvObuDelay.text = "obu时延:" + delayTime.toString()
|
||||
}
|
||||
}
|
||||
@@ -1775,7 +1687,7 @@ class DebugSettingView @JvmOverloads constructor(
|
||||
* @param steering 方向盘转向角
|
||||
*/
|
||||
override fun onAutopilotSteeringData(steering: Float) {
|
||||
ThreadUtils.runOnUiThread{
|
||||
ThreadUtils.runOnUiThread {
|
||||
tvSteeringInfo.text = "方向盘转向角:${steering}"
|
||||
}
|
||||
}
|
||||
@@ -1785,7 +1697,7 @@ class DebugSettingView @JvmOverloads constructor(
|
||||
* @param gear 档位
|
||||
*/
|
||||
override fun onAutopilotGearData(gear: Chassis.GearPosition) {
|
||||
ThreadUtils.runOnUiThread{
|
||||
ThreadUtils.runOnUiThread {
|
||||
tvGearInfo.text = "挂挡档位:${gear}"
|
||||
}
|
||||
}
|
||||
@@ -1804,7 +1716,7 @@ class DebugSettingView @JvmOverloads constructor(
|
||||
this.clickListener = clickListener
|
||||
}
|
||||
|
||||
interface ClickListener{
|
||||
interface ClickListener {
|
||||
fun showReportListWindow(show: Boolean)
|
||||
}
|
||||
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -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)
|
||||
|
||||
@@ -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>
|
||||
@@ -636,36 +636,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"
|
||||
|
||||
@@ -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>
|
||||
@@ -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>
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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
|
||||
)
|
||||
@@ -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"
|
||||
|
||||
}
|
||||
}
|
||||
@@ -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?){}
|
||||
|
||||
}
|
||||
@@ -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 {
|
||||
/**
|
||||
* 注册车辆监控变化监听
|
||||
*
|
||||
|
||||
@@ -27,6 +27,11 @@ interface IMoGoDevaToolsListener {
|
||||
*/
|
||||
fun onLogCatch(lineLog: String)
|
||||
|
||||
/**
|
||||
* fw线程写入,倒计时结束
|
||||
*/
|
||||
fun fwThreadClose()
|
||||
|
||||
/**
|
||||
* 模块TAG更新回调
|
||||
*/
|
||||
|
||||
@@ -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
|
||||
|
||||
/**
|
||||
@@ -215,4 +216,10 @@ interface IMoGoWaringProvider : IMoGoHmiViewProxy {
|
||||
* @param msg
|
||||
*/
|
||||
fun showDockerRebootResult(code: Int,msg: String)
|
||||
|
||||
/**
|
||||
* 展示工控机监控上报数据
|
||||
* @param reportList 上报数据列表
|
||||
*/
|
||||
fun showIPCReportWindow(reportList: ArrayList<ReportEntity>)
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package com.mogo.eagle.core.function.api.map.deva
|
||||
|
||||
interface IMoGoMapDevaProvider {
|
||||
|
||||
/**
|
||||
* 压缩并上传地图日志
|
||||
*/
|
||||
fun uploadFile(filePath: String)
|
||||
}
|
||||
@@ -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, "自动驾驶控制参数异常,请检查参数信息")
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
@@ -320,4 +321,12 @@ object CallerHmiManager : CallerBase() {
|
||||
waringProviderApi?.setProxyNotificationView(view)
|
||||
}
|
||||
|
||||
/**
|
||||
* 展示工控机监控上报数据
|
||||
* @param reportList 上报数据列表
|
||||
*/
|
||||
fun showIPCReportWindow(reportList: ArrayList<ReportEntity>){
|
||||
waringProviderApi?.showIPCReportWindow(reportList)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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()
|
||||
|
||||
@@ -60,7 +60,7 @@ HOOK_LOG_VERSION=1.6.1
|
||||
SERVICE_CHAIN_VERSION=1.1.0
|
||||
################ 外部依赖引用 ################
|
||||
# loglib
|
||||
LOGLIB_VERSION=1.2.30
|
||||
LOGLIB_VERSION=1.2.46
|
||||
######## MogoAiCloudSDK Version ########
|
||||
# 网络请求LOGLIB_VERSION
|
||||
MOGO_NETWORK_VERSION=1.3.55
|
||||
@@ -82,7 +82,7 @@ MOGO_LOCATION_VERSION=1.3.55
|
||||
MOGO_TELEMATIC_VERSION=1.3.55
|
||||
######## MogoAiCloudSDK Version ########
|
||||
# 自研地图
|
||||
MAP_SDK_VERSION=2.1.1
|
||||
MAP_SDK_VERSION=2.1.1.2
|
||||
MAP_SDK_OPERATION_VERSION=1.0.13
|
||||
# websocket
|
||||
WEBSOCKET_VERSION=1.1.7
|
||||
|
||||
@@ -1,12 +1,17 @@
|
||||
package com.zhidao.support.adas.high;
|
||||
|
||||
|
||||
import static com.zhidao.support.adas.high.chain.AdasChain.CHAIN_ALIAS_CODE_ADAS_START_AUTOPILOT;
|
||||
import static com.zhidao.support.adas.high.chain.AdasChain.CHAIN_ALIAS_CODE_CONNECT_ADDRESS;
|
||||
import static com.zhidao.support.adas.high.chain.AdasChain.CHAIN_ALIAS_CODE_INIT;
|
||||
import static com.zhidao.support.adas.high.chain.AdasChain.CHAIN_ALIAS_CODE_STATUS_CHANGE_REASON;
|
||||
import static com.zhidao.support.adas.high.chain.AdasChain.CHAIN_ALIAS_CODE_WEB_SOCKET_MESSAGE_BYTE;
|
||||
import static com.zhidao.support.adas.high.chain.AdasChain.CHAIN_LINK_ADAS;
|
||||
import static com.zhidao.support.adas.high.chain.AdasChain.CHAIN_LINK_LOG_CONNECT_STATUS;
|
||||
import static com.zhidao.support.adas.high.chain.AdasChain.CHAIN_LINK_LOG_WEB_SOCKET_AUTOPILOT;
|
||||
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
@@ -430,6 +435,12 @@ public class AdasChannel implements IAdasNetCommApi, FpgaSocket.IWebSocketConnec
|
||||
* @param reason 状态描述
|
||||
* 如果ipcConnectionStatus == Constants.IPC_CONNECTION_STATUS.DISCONNECTED && reason==null 表示主动断开连接
|
||||
*/
|
||||
@ChainLog(linkChainLog = CHAIN_LINK_LOG_CONNECT_STATUS,
|
||||
linkCode = CHAIN_LINK_ADAS,
|
||||
endpoint = TracingConstants.Endpoint.PAD,
|
||||
nodeAliasCode = CHAIN_ALIAS_CODE_STATUS_CHANGE_REASON,
|
||||
paramIndexes = {1},
|
||||
clientPkFileName = "sn")
|
||||
private void updateConnectStatus(@Define.IPCConnectionStatus int status, @Nullable String reason) {
|
||||
ipcConnectionStatus.set(status);
|
||||
if (adasConnectStatusListener != null) {
|
||||
@@ -576,6 +587,14 @@ public class AdasChannel implements IAdasNetCommApi, FpgaSocket.IWebSocketConnec
|
||||
* @param routeInfo 自动驾驶路径信息
|
||||
* @return boolean
|
||||
*/
|
||||
@ChainLog(
|
||||
linkChainLog = CHAIN_LINK_LOG_WEB_SOCKET_AUTOPILOT,
|
||||
linkCode = CHAIN_LINK_ADAS,
|
||||
endpoint = TracingConstants.Endpoint.PAD,
|
||||
nodeAliasCode = CHAIN_ALIAS_CODE_ADAS_START_AUTOPILOT,
|
||||
paramIndexes = {2},
|
||||
clientPkFileName = "sn"
|
||||
)
|
||||
@Override
|
||||
public boolean sendAutoPilotModeReq(int mode, int source, MessagePad.RouteInfo routeInfo) {
|
||||
MessagePad.SetAutopilotModeReq.Builder builder = MessagePad.SetAutopilotModeReq.newBuilder();
|
||||
|
||||
@@ -5,11 +5,15 @@ public class AdasChain {
|
||||
public static final int CHAIN_LINK_ADAS = 1;
|
||||
|
||||
public static final int CHAIN_LINK_LOG_CONNECT_STATUS = 0;
|
||||
public static final int CHAIN_LINK_LOG_WEB_SOCKET_DATA = 1;
|
||||
public static final int CHAIN_LINK_LOG_WEB_SOCKET_AUTOPILOT = 1;
|
||||
|
||||
public static final String CHAIN_ALIAS_CODE_INIT = "PAD_ADAS_INIT";
|
||||
public static final String CHAIN_ALIAS_CODE_STATUS_CHANGE_REASON = "CHAIN_ALIAS_CODE_STATUS_CHANGE_REASON";
|
||||
public static final String CHAIN_ALIAS_CODE_CONNECT_ADDRESS = "PAD_ADAS_CONNECT_ADDRESS";
|
||||
public static final String CHAIN_ALIAS_CODE_WEB_SOCKET_OPEN = "PAD_ADAS_WEB_SOCKET_OPEN";
|
||||
public static final String CHAIN_ALIAS_CODE_WEB_SOCKET_MESSAGE_JSON = "PAD_ADAS_WEB_SOCKET_MESSAGE_JSON";
|
||||
public static final String CHAIN_ALIAS_CODE_WEB_SOCKET_MESSAGE_BYTE = "PAD_ADAS_WEB_SOCKET_MESSAGE_BYTE";
|
||||
|
||||
//operation by user
|
||||
public static final String CHAIN_ALIAS_CODE_ADAS_START_AUTOPILOT = "CHAIN_ALIAS_CODE_ADAS_START_AUTOPILOT";
|
||||
}
|
||||
|
||||
@@ -0,0 +1,104 @@
|
||||
package com.zhidao.support.adas.high.common;
|
||||
|
||||
import mogo.telematics.pad.MessagePad;
|
||||
import rule_segement.PointCloud;
|
||||
|
||||
/**
|
||||
* 点云数据解码器
|
||||
* 时间戳,lon,lat,alt,yaw,roll,patch,新增数据大小,id,x,y,z,强度,……,删除数据大小,id,x,y,z,强度,……
|
||||
* 如果add_data 没有数据 新增数据大小用-1表示
|
||||
* 如果del_data 没有数据 删除数据大小用-2表示
|
||||
* 如果又不存在的数会使用0.0补位
|
||||
* 目前工控机所发送数据没用ID 所以默认用0代替
|
||||
*/
|
||||
public class PointCloudDecoder {
|
||||
/**
|
||||
* add 和del 列表中 多少一个数据为一组
|
||||
* 目前缺少id所以是4个
|
||||
*/
|
||||
private static final int NUMBER_OF_DATA = 4;
|
||||
|
||||
public static String decode(MessagePad.Header header, PointCloud.LidarPointCloud pointCloud) {
|
||||
StringBuilder builder = new StringBuilder();
|
||||
builder.append(((long) header.getTimestamp() * 1000.0D)).append(",");
|
||||
double d;
|
||||
if (pointCloud.hasSelfLongitude()) {
|
||||
d = pointCloud.getSelfLongitude();
|
||||
} else {
|
||||
d = 0;
|
||||
}
|
||||
builder.append(d).append(",");
|
||||
if (pointCloud.hasSelfLatitude()) {
|
||||
d = pointCloud.getSelfLatitude();
|
||||
} else {
|
||||
d = 0;
|
||||
}
|
||||
builder.append(d).append(",");
|
||||
if (pointCloud.hasSelfAltitude()) {
|
||||
d = pointCloud.getSelfAltitude();
|
||||
} else {
|
||||
d = 0;
|
||||
}
|
||||
builder.append(d).append(",");
|
||||
if (pointCloud.hasSelfYaw()) {
|
||||
d = pointCloud.getSelfYaw();
|
||||
} else {
|
||||
d = 0;
|
||||
}
|
||||
builder.append(d).append(",");
|
||||
if (pointCloud.hasSelfRoll()) {
|
||||
d = pointCloud.getSelfRoll();
|
||||
} else {
|
||||
d = 0;
|
||||
}
|
||||
builder.append(d).append(",");
|
||||
if (pointCloud.hasSelfPitch()) {
|
||||
d = pointCloud.getSelfPitch();
|
||||
} else {
|
||||
d = 0;
|
||||
}
|
||||
builder.append(d).append(",");
|
||||
int addSize = pointCloud.getAddDataCount() / NUMBER_OF_DATA;
|
||||
int delSize = pointCloud.getDelDataCount() / NUMBER_OF_DATA;
|
||||
if (addSize == 0 && delSize == 0) {
|
||||
builder.append(-1).append(",").append(-2);
|
||||
} else {
|
||||
StringBuilder add = new StringBuilder();
|
||||
StringBuilder del = new StringBuilder();
|
||||
int i = 0;
|
||||
while (i < delSize || i < addSize) {
|
||||
int temp = i * NUMBER_OF_DATA;
|
||||
if (i < addSize) {
|
||||
//目前没有id 默认插入0
|
||||
add.append(0).append(",");
|
||||
add.append(pointCloud.getAddData(temp++)).append(",");
|
||||
add.append(pointCloud.getAddData(temp++)).append(",");
|
||||
add.append(pointCloud.getAddData(temp++)).append(",");
|
||||
add.append(pointCloud.getAddData(temp)).append(",");
|
||||
}
|
||||
if (i < delSize) {
|
||||
temp = i * NUMBER_OF_DATA;
|
||||
//目前没有id 默认插入0
|
||||
del.append(0).append(",");
|
||||
del.append(pointCloud.getDelData(temp++)).append(",");
|
||||
del.append(pointCloud.getDelData(temp++)).append(",");
|
||||
del.append(pointCloud.getDelData(temp++)).append(",");
|
||||
del.append(pointCloud.getDelData(temp)).append(",");
|
||||
}
|
||||
i++;
|
||||
}
|
||||
if (addSize == 0) {
|
||||
builder.append(-1).append(",");
|
||||
} else {
|
||||
builder.append(addSize).append(",").append(add);
|
||||
}
|
||||
if (delSize == 0) {
|
||||
builder.append(-2);
|
||||
} else {
|
||||
del.deleteCharAt(del.length() - 1);
|
||||
builder.append(delSize).append(",").append(del);
|
||||
}
|
||||
}
|
||||
return builder.toString();
|
||||
}
|
||||
}
|
||||
@@ -12,7 +12,7 @@ import java.util.concurrent.atomic.AtomicBoolean;
|
||||
public class ReceiveTimeoutManager {
|
||||
private static final String TAG = ReceiveTimeoutManager.class.getSimpleName();
|
||||
private static volatile ReceiveTimeoutManager INSTANCE;
|
||||
private static final long DEFAULT_TIMEOUT = 4 * 1000L;//默认超时时间
|
||||
private static final long DEFAULT_TIMEOUT = 3 * 1000L;//默认超时时间
|
||||
private final AtomicBoolean isEnable = new AtomicBoolean(true);//是否启用超时检测
|
||||
private volatile long lastReceiveTime;
|
||||
private OnTimeoutListener listener;
|
||||
|
||||
@@ -3,7 +3,6 @@ package com.zhidao.support.adas.high.msg;
|
||||
import com.google.gson.Gson;
|
||||
import com.google.protobuf.InvalidProtocolBufferException;
|
||||
import com.zhidao.support.adas.high.OnAdasListener;
|
||||
import com.zhidao.support.adas.high.common.ReceiveTimeoutManager;
|
||||
|
||||
import mogo.telematics.pad.MessagePad;
|
||||
|
||||
@@ -18,7 +17,6 @@ public class AutopilotStateMessage extends MyAbstractMessageHandler {
|
||||
|
||||
@Override
|
||||
public void handlerMsg(MessagePad.Header header, byte[] msg, OnAdasListener adasListener) throws InvalidProtocolBufferException {
|
||||
ReceiveTimeoutManager.getInstance().refreshLast();
|
||||
MessagePad.AutopilotState autopilotState = MessagePad.AutopilotState.parseFrom(msg);
|
||||
if (adasListener != null) {
|
||||
adasListener.onAutopilotState(header, autopilotState);
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.zhidao.support.adas.high.msg;
|
||||
import com.google.gson.Gson;
|
||||
import com.google.protobuf.InvalidProtocolBufferException;
|
||||
import com.zhidao.support.adas.high.OnAdasListener;
|
||||
import com.zhidao.support.adas.high.common.ReceiveTimeoutManager;
|
||||
|
||||
import mogo.telematics.pad.MessagePad;
|
||||
|
||||
@@ -17,6 +18,7 @@ public class GnssInfoMessage extends MyAbstractMessageHandler {
|
||||
|
||||
@Override
|
||||
public void handlerMsg(MessagePad.Header header, byte[] msg, OnAdasListener adasListener) throws InvalidProtocolBufferException {
|
||||
ReceiveTimeoutManager.getInstance().refreshLast();
|
||||
MessagePad.GnssInfo trajectory = MessagePad.GnssInfo.parseFrom(msg);
|
||||
if (adasListener != null) {
|
||||
adasListener.onGnssInfo(header, trajectory);
|
||||
|
||||
@@ -22,6 +22,8 @@ import android.util.Log;
|
||||
import android.view.MotionEvent;
|
||||
import android.view.View;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.mogo.commons.constants.SharedPrefsConstants;
|
||||
import com.mogo.commons.debug.DebugConfig;
|
||||
import com.mogo.eagle.core.data.config.HdMapBuildConfig;
|
||||
@@ -31,6 +33,7 @@ import com.mogo.eagle.core.data.map.MapRoadInfo;
|
||||
import com.mogo.eagle.core.data.map.MogoLatLng;
|
||||
import com.mogo.eagle.core.data.map.MogoLocation;
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapDataCollectorManager;
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapDevaListenerManager;
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapLocationListenerManager;
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapRoadListenerManager;
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapStyleListenerManager;
|
||||
@@ -60,6 +63,7 @@ import com.zhidaoauto.map.sdk.open.abs.OnMapStyleListener;
|
||||
import com.zhidaoauto.map.sdk.open.abs.OnMapTouchListener;
|
||||
import com.zhidaoauto.map.sdk.open.abs.OnMapViewVisualAngleChangeListener;
|
||||
import com.zhidaoauto.map.sdk.open.abs.OnRoadInfoListener;
|
||||
import com.zhidaoauto.map.sdk.open.abs.log.ILog;
|
||||
import com.zhidaoauto.map.sdk.open.camera.CameraPosition;
|
||||
import com.zhidaoauto.map.sdk.open.camera.CameraUpdateFactory;
|
||||
import com.zhidaoauto.map.sdk.open.camera.LatLngBounds;
|
||||
@@ -96,7 +100,7 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
OnMarkClickListener,
|
||||
OnMapStyleListener,
|
||||
OnMapViewVisualAngleChangeListener,
|
||||
OnRoadInfoListener {
|
||||
OnRoadInfoListener, ILog {
|
||||
|
||||
private static final String TAG = "AMapViewWrapper";
|
||||
private final MapAutoView mMapView;
|
||||
@@ -116,7 +120,7 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
private boolean mIsDelayed = false;
|
||||
|
||||
public AMapViewWrapper(MapAutoView mMapView) {
|
||||
CallerLogger.INSTANCE.i(M_MAP+TAG, "autoop--AMapViewWrapper: init");
|
||||
CallerLogger.INSTANCE.i(M_MAP + TAG, "autoop--AMapViewWrapper: init");
|
||||
this.mMapView = mMapView;
|
||||
initViews();
|
||||
initListeners();
|
||||
@@ -183,17 +187,18 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
mMapView.setOnMapStyleListener(this);
|
||||
mMapView.setOnMapViewVisualAngleChangeListener(this);
|
||||
mMapView.setOnRoadInfoListener(this, 1);
|
||||
CallerLogger.INSTANCE.d(M_MAP+TAG, "styleop - initListeners - setOnMapStyleListener - view " + mMapView);
|
||||
MapAutoApi.INSTANCE.registerLogListener(this);
|
||||
CallerLogger.INSTANCE.d(M_MAP + TAG, "styleop - initListeners - setOnMapStyleListener - view " + mMapView);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRoadIdInfo(@androidx.annotation.Nullable String roadId) {
|
||||
|
||||
if (roadId != null && !TextUtils.isEmpty(roadId)) {
|
||||
CallerLogger.INSTANCE.d(M_MAP+TAG, "onRoadIdInfo::" + roadId);
|
||||
CallerLogger.INSTANCE.d(M_MAP + TAG, "onRoadIdInfo::" + roadId);
|
||||
CallerMapRoadListenerManager.INSTANCE.invokeListenersOnRoadIdGet(roadId);
|
||||
} else {
|
||||
CallerLogger.INSTANCE.d(M_MAP+TAG, "onRoadIdInfo::null");
|
||||
CallerLogger.INSTANCE.d(M_MAP + TAG, "onRoadIdInfo::null");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -211,27 +216,27 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
* }
|
||||
*/
|
||||
String provider = carLoc.getProvider();
|
||||
CallerLogger.INSTANCE.d(M_MAP+TAG, "car_loc: " + carLoc + "");
|
||||
CallerLogger.INSTANCE.d(M_MAP + TAG, "car_loc: " + carLoc + "");
|
||||
if (!MapAutoApi.GPS_FLAG.equals(provider)) {
|
||||
CallerLogger.INSTANCE.d(M_MAP+TAG, "convert before: car_loc: {lon: " + carLoc.getLongitude() + ", lat: " + carLoc.getLatitude() + "}");
|
||||
CallerLogger.INSTANCE.d(M_MAP + TAG, "convert before: car_loc: {lon: " + carLoc.getLongitude() + ", lat: " + carLoc.getLatitude() + "}");
|
||||
LonLatPoint p = new LonLatPoint(carLoc.getLongitude(), carLoc.getLatitude());
|
||||
p = MapTools.INSTANCE.switchLonLatWGS84(p);
|
||||
carLoc.setLongitude(p.longitude);
|
||||
carLoc.setLatitude(p.latitude);
|
||||
CallerLogger.INSTANCE.d(M_MAP+TAG, "convert after: car_loc: {lon: " + carLoc.getLongitude() + ", lat: " + carLoc.getLatitude() + "}");
|
||||
CallerLogger.INSTANCE.d(M_MAP + TAG, "convert after: car_loc: {lon: " + carLoc.getLongitude() + ", lat: " + carLoc.getLatitude() + "}");
|
||||
}
|
||||
CallerLogger.INSTANCE.d(M_MAP+TAG, "onStopLineInfo:stop_line" + stopLine + ", car_loc:{lon: " + carLoc.getLatitude() + ", lat: " + carLoc.getLongitude() + "}");
|
||||
CallerLogger.INSTANCE.d(M_MAP + TAG, "onStopLineInfo:stop_line" + stopLine + ", car_loc:{lon: " + carLoc.getLatitude() + ", lat: " + carLoc.getLongitude() + "}");
|
||||
MapRoadInfo.StopLine stopInfo = convert(stopLine);
|
||||
LonLatPoint p1 = points.get(0);
|
||||
LonLatPoint p2 = points.get(points.size() - 1);
|
||||
double distanceOfCarToStopLine = MapDataApi.INSTANCE.getNearstFromPointToSegment(carLoc.getLongitude(), carLoc.getLatitude(), p1.longitude, p1.latitude, p2.longitude, p2.latitude) * 10_0000;
|
||||
stopInfo.setDistanceOfCarToStopLine(distanceOfCarToStopLine);
|
||||
CallerLogger.INSTANCE.d(M_MAP+TAG, "onStopLineInfo: --- distance: " + distanceOfCarToStopLine);
|
||||
CallerLogger.INSTANCE.d(M_MAP + TAG, "onStopLineInfo: --- distance: " + distanceOfCarToStopLine);
|
||||
CallerMapRoadListenerManager.INSTANCE.invokeListenersOnStopLineGet(stopInfo);
|
||||
}
|
||||
} else {
|
||||
if (carLoc != null) {
|
||||
CallerLogger.INSTANCE.d(M_MAP+TAG, "onStopLineInfo::null, car_loc:{lon: " + carLoc.getLatitude() + ", lat: " + carLoc.getLongitude() + "}");
|
||||
CallerLogger.INSTANCE.d(M_MAP + TAG, "onStopLineInfo::null, car_loc:{lon: " + carLoc.getLatitude() + ", lat: " + carLoc.getLongitude() + "}");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -279,7 +284,7 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
public void onCreate(Bundle bundle) {
|
||||
if (mMapView != null) {
|
||||
mMapView.onCreate(bundle);
|
||||
CallerLogger.INSTANCE.d(M_MAP+TAG, "map onCreate");
|
||||
CallerLogger.INSTANCE.d(M_MAP + TAG, "map onCreate");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -287,7 +292,7 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
public void onResume() {
|
||||
if (mMapView != null) {
|
||||
mMapView.onResume();
|
||||
CallerLogger.INSTANCE.d(M_MAP+TAG, "map onResume");
|
||||
CallerLogger.INSTANCE.d(M_MAP + TAG, "map onResume");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -295,7 +300,7 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
public void onPause() {
|
||||
if (mMapView != null) {
|
||||
mMapView.onPause();
|
||||
CallerLogger.INSTANCE.d(M_MAP+TAG, "map onPause");
|
||||
CallerLogger.INSTANCE.d(M_MAP + TAG, "map onPause");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -309,7 +314,8 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
mMapView.setOnMapClickListener(null);
|
||||
mMapView.getLocationClient().unRegisterListener(this);
|
||||
mMapView.setOnCameraChangeListener(null);
|
||||
CallerLogger.INSTANCE.d(M_MAP+TAG, "map onDestroy");
|
||||
MapAutoApi.INSTANCE.unregisterLogListener(this);
|
||||
CallerLogger.INSTANCE.d(M_MAP + TAG, "map onDestroy");
|
||||
}
|
||||
|
||||
if (mLocationTask != null) {
|
||||
@@ -321,7 +327,7 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
public void onSaveInstanceState(Bundle outState) {
|
||||
if (mMapView != null) {
|
||||
mMapView.onSaveInstanceState(outState);
|
||||
CallerLogger.INSTANCE.d(M_MAP+TAG, "map onSaveInstanceState");
|
||||
CallerLogger.INSTANCE.d(M_MAP + TAG, "map onSaveInstanceState");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -335,9 +341,9 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
if (isVrMold()) {
|
||||
return MapControlResult.ERROR;
|
||||
}
|
||||
CallerLogger.INSTANCE.d(M_MAP+TAG, "changeZoom : " + zoom);
|
||||
CallerLogger.INSTANCE.d(M_MAP + TAG, "changeZoom : " + zoom);
|
||||
if (DebugConfig.isDebug()) {
|
||||
CallerLogger.INSTANCE.d(M_MAP+TAG, Log.getStackTraceString(new Throwable()));
|
||||
CallerLogger.INSTANCE.d(M_MAP + TAG, Log.getStackTraceString(new Throwable()));
|
||||
}
|
||||
getMap().changeZoom(zoom);
|
||||
return MapControlResult.SUCCESS;
|
||||
@@ -351,7 +357,7 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
mVisualAngleMode = angelMode;
|
||||
if (angelMode == MODE_CLOSE_SIGHT) {
|
||||
if (mogoLatLng == null) {
|
||||
CallerLogger.INSTANCE.e(M_MAP+TAG, "切换地图近景需要传入要移动的经纬度数据");
|
||||
CallerLogger.INSTANCE.e(M_MAP + TAG, "切换地图近景需要传入要移动的经纬度数据");
|
||||
return;
|
||||
}
|
||||
// 近景传入经纬度为点击地图上静态marker经纬度数据,为GPS坐标点。
|
||||
@@ -374,7 +380,7 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
|
||||
private boolean checkAMapView() {
|
||||
if (mMapView == null || mMapView.getMapAutoViewHelper() == null) {
|
||||
CallerLogger.INSTANCE.e(M_MAP+TAG, "自研mapView实例为空,请检查");
|
||||
CallerLogger.INSTANCE.e(M_MAP + TAG, "自研mapView实例为空,请检查");
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
@@ -382,20 +388,20 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
|
||||
@Override
|
||||
public void moveToCenter(MogoLatLng latLng, boolean animate) {
|
||||
CallerLogger.INSTANCE.d(M_MAP+TAG, "move to center " + latLng);
|
||||
CallerLogger.INSTANCE.d(M_MAP + TAG, "move to center " + latLng);
|
||||
if (latLng == null || latLng.lat == 0.0d || latLng.lon == 0.0d) {
|
||||
CallerLogger.INSTANCE.e(M_MAP+TAG, "latlng = null or is illegal");
|
||||
CallerLogger.INSTANCE.e(M_MAP + TAG, "latlng = null or is illegal");
|
||||
return;
|
||||
}
|
||||
if (DebugConfig.isDebug()) {
|
||||
CallerLogger.INSTANCE.d(M_MAP+TAG, Log.getStackTraceString(new Throwable()));
|
||||
CallerLogger.INSTANCE.d(M_MAP + TAG, Log.getStackTraceString(new Throwable()));
|
||||
}
|
||||
mMapView.getMapAutoViewHelper().animateCamera(new LonLatPoint(latLng.lon, latLng.lat));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void showMyLocation(boolean visible) {
|
||||
CallerLogger.INSTANCE.d(M_MAP+TAG, "showMyLocation1 " + visible);
|
||||
CallerLogger.INSTANCE.d(M_MAP + TAG, "showMyLocation1 " + visible);
|
||||
// 如果是VR模式
|
||||
if (isVrMold()) {
|
||||
return;
|
||||
@@ -418,7 +424,7 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
*/
|
||||
private boolean isVrMold() {
|
||||
boolean isVrMode = mCurrentUI == EnumMapUI.MAP_STYLE_NIGHT_VR || mCurrentUI == EnumMapUI.MAP_STYLE_DAY_VR;
|
||||
CallerLogger.INSTANCE.d(M_MAP+TAG, "是否是VR模式: " + isVrMode);
|
||||
CallerLogger.INSTANCE.d(M_MAP + TAG, "是否是VR模式: " + isVrMode);
|
||||
return isVrMode;
|
||||
}
|
||||
|
||||
@@ -431,14 +437,14 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
boolean isDayMode = mCurrentUI == EnumMapUI.MAP_STYLE_DAY_VR
|
||||
|| mCurrentUI == EnumMapUI.MAP_STYLE_DAY
|
||||
|| mCurrentUI == EnumMapUI.MAP_STYLE_DAY_NAV;
|
||||
CallerLogger.INSTANCE.d(M_MAP+TAG, "是否是白天模式: " + isDayMode);
|
||||
CallerLogger.INSTANCE.d(M_MAP + TAG, "是否是白天模式: " + isDayMode);
|
||||
return isDayMode;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void showMyLocation(View view) {
|
||||
if (DebugConfig.isDebug()) {
|
||||
CallerLogger.INSTANCE.d(M_MAP+TAG, Log.getStackTraceString(new Throwable()));
|
||||
CallerLogger.INSTANCE.d(M_MAP + TAG, Log.getStackTraceString(new Throwable()));
|
||||
}
|
||||
if (checkAMapView()) {
|
||||
MyLocationStyle style = mMapView.getMapAutoViewHelper().getMyLocationStyle();
|
||||
@@ -507,7 +513,7 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
if (isVrMold()) {
|
||||
return;
|
||||
}
|
||||
CallerLogger.INSTANCE.d(M_MAP+TAG, "setPointToCenter x : " + mapCenterX + " y : " + mapCenterY);
|
||||
CallerLogger.INSTANCE.d(M_MAP + TAG, "setPointToCenter x : " + mapCenterX + " y : " + mapCenterY);
|
||||
mMapView.getMapAutoViewHelper().setPointToCenter((float) mapCenterX, (float) mapCenterY);
|
||||
}
|
||||
}
|
||||
@@ -544,7 +550,7 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
if (checkAMapView()) {
|
||||
if (mMapView.getMapAutoViewHelper() != null) {
|
||||
mMapView.getMapAutoViewHelper().setRenderFps(fps);
|
||||
CallerLogger.INSTANCE.d(M_MAP+TAG, "设置刷新帧率 fps = " + fps);
|
||||
CallerLogger.INSTANCE.d(M_MAP + TAG, "设置刷新帧率 fps = " + fps);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -555,16 +561,16 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
return;
|
||||
}
|
||||
if (isVrMold()) {
|
||||
CallerLogger.INSTANCE.w(M_MAP+TAG, "vr 模式下忽略该设置");
|
||||
CallerLogger.INSTANCE.w(M_MAP + TAG, "vr 模式下忽略该设置");
|
||||
return;
|
||||
}
|
||||
CallerLogger.INSTANCE.i(M_MAP+TAG, "showBounds : " + M_MAP+TAG + " , " + carPosition.toString() + " , " + bound.toShortString() + " , " + lockCarPosition);
|
||||
CallerLogger.INSTANCE.i(M_MAP + TAG, "showBounds : " + M_MAP + TAG + " , " + carPosition.toString() + " , " + bound.toShortString() + " , " + lockCarPosition);
|
||||
try {
|
||||
LatLngBounds latLngBounds = MogoMapUtils.getLatLngBounds(carPosition, lonLats, lockCarPosition);
|
||||
mMapView.getMapAutoViewHelper().setCenter(ObjectUtils.fromMogo(carPosition));
|
||||
mMapView.getMapAutoViewHelper().moveCamera(CameraUpdateFactory.INSTANCE.newLatLngBounds(latLngBounds, bound.left, bound.right, bound.top, bound.bottom));
|
||||
} catch (Exception e) {
|
||||
CallerLogger.INSTANCE.e(M_MAP+TAG, "M_MAP+TAG : " + M_MAP+TAG + " error : " + e);
|
||||
CallerLogger.INSTANCE.e(M_MAP + TAG, "M_MAP+TAG : " + M_MAP + TAG + " error : " + e);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -672,6 +678,11 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
return ObjectUtils.transformCenterLine(MapDataApi.INSTANCE.getCenterLineInfo(lon, lat, angle));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void result(@NonNull String filePath) {
|
||||
CallerMapDevaListenerManager.INSTANCE.invokeUploadLogFile(filePath);
|
||||
}
|
||||
|
||||
private static class LocationTask implements Runnable {
|
||||
|
||||
private MogoLocation location;
|
||||
@@ -698,7 +709,7 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
MogoLocation currentLocation = ObjectUtils.fromLocation(location);
|
||||
if (Looper.myLooper() == Looper.getMainLooper()) {
|
||||
CallerMapLocationListenerManager.INSTANCE.invokeMapLocationChangeListener(currentLocation, 1);
|
||||
} else {
|
||||
} else {
|
||||
if (mLocationTask == null) {
|
||||
mLocationTask = new LocationTask();
|
||||
}
|
||||
@@ -742,7 +753,11 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
} else {
|
||||
mIsFirstLocated = true;
|
||||
mIsDelayed = false;
|
||||
CallerLogger.INSTANCE.d(M_MAP+TAG, "同步定位:" + GsonUtils.toJson(location));
|
||||
try {
|
||||
CallerLogger.INSTANCE.d(M_MAP + TAG, "同步定位:" + GsonUtils.toJson(location));
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -755,13 +770,13 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
|
||||
@Override
|
||||
public void onMapInit() {
|
||||
CallerLogger.INSTANCE.i(M_MAP+TAG, "autoop--onMapInit: ");
|
||||
CallerLogger.INSTANCE.i(M_MAP + TAG, "autoop--onMapInit: ");
|
||||
MogoMapListenerHandler.getInstance().onMapLoaded();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onMapLoaded() {
|
||||
CallerLogger.INSTANCE.i(M_MAP+TAG, "autoop--onMapLoaded: ");
|
||||
CallerLogger.INSTANCE.i(M_MAP + TAG, "autoop--onMapLoaded: ");
|
||||
mMapLoaded = true;
|
||||
CameraPosition cameraPosition = mMapView.getMapAutoViewHelper().getCameraPosition();
|
||||
Trace.beginSection("timer.onCameraChangeFinish");
|
||||
@@ -788,7 +803,7 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
|
||||
@Override
|
||||
public void onRoadLoaded(@Nullable String s) {
|
||||
CallerLogger.INSTANCE.i(M_MAP+TAG, "autoop--onMapLoaded: ");
|
||||
CallerLogger.INSTANCE.i(M_MAP + TAG, "autoop--onMapLoaded: ");
|
||||
|
||||
}
|
||||
|
||||
@@ -799,7 +814,7 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
|
||||
@Override
|
||||
public void onMapViewVisualAngleChange(int i) {
|
||||
CallerLogger.INSTANCE.d(M_MAP+TAG, " 地图自动更改视距 currentThread : " + Thread.currentThread().getName());
|
||||
CallerLogger.INSTANCE.d(M_MAP + TAG, " 地图自动更改视距 currentThread : " + Thread.currentThread().getName());
|
||||
mVisualAngleMode = getVisualAngleMode(i);
|
||||
MogoMapListenerHandler.getInstance().onMapVisualAngleChanged(mVisualAngleMode);
|
||||
}
|
||||
@@ -849,8 +864,8 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
|
||||
@Override
|
||||
public void onChangeMapStyle(int styleId) {
|
||||
CallerLogger.INSTANCE.d(M_MAP+TAG, "currentMapStyle = " + styleId);
|
||||
CallerLogger.INSTANCE.d(M_MAP+TAG, Log.getStackTraceString(new Throwable()));
|
||||
CallerLogger.INSTANCE.d(M_MAP + TAG, "currentMapStyle = " + styleId);
|
||||
CallerLogger.INSTANCE.d(M_MAP + TAG, Log.getStackTraceString(new Throwable()));
|
||||
|
||||
// 映射地图样式ID到鹰眼样式ID
|
||||
if (styleId == MapAutoApi.MAP_STYLE_DAY
|
||||
@@ -871,7 +886,7 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
if (mCurrentUI != null) {
|
||||
UiThreadHandler.post(() -> {
|
||||
try {
|
||||
CallerLogger.INSTANCE.d(M_MAP+TAG, "currentUI = " + mCurrentUI);
|
||||
CallerLogger.INSTANCE.d(M_MAP + TAG, "currentUI = " + mCurrentUI);
|
||||
MogoMapListenerHandler.getInstance().onMapModeChanged(mCurrentUI);
|
||||
CallerMapStyleListenerManager.INSTANCE.invokeMapStyleChange(styleId);
|
||||
} catch (Exception e) {
|
||||
@@ -891,7 +906,7 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
TipToast.shortTip(mRtkEnable ? "已开启rtk道路匹配" : "已开启gps道路匹配");
|
||||
mMapView.getLocationClient().rtkEnable(mRtkEnable);
|
||||
} catch (Exception e) {
|
||||
CallerLogger.INSTANCE.e(M_MAP+TAG, "rtkEnable has exception : " + e);
|
||||
CallerLogger.INSTANCE.e(M_MAP + TAG, "rtkEnable has exception : " + e);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -901,7 +916,7 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
return;
|
||||
}
|
||||
if (data == null) {
|
||||
CallerLogger.INSTANCE.d(M_MAP+TAG, "停止使用rtk定位数据");
|
||||
CallerLogger.INSTANCE.d(M_MAP + TAG, "停止使用rtk定位数据");
|
||||
return;
|
||||
}
|
||||
double lon = data.optDouble("lon", -1);
|
||||
@@ -1001,7 +1016,7 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
* 加载3D模型
|
||||
*/
|
||||
private void loadPreVehicleModel() {
|
||||
CallerLogger.INSTANCE.d(M_MAP+TAG, "添加感知模型到地图中……");
|
||||
CallerLogger.INSTANCE.d(M_MAP + TAG, "添加感知模型到地图中……");
|
||||
addPreVehicleModelWeiZhi(TrafficTypeEnum.TYPE_TRAFFIC_ID_WEI_ZHI, "添加感知模型到地图中……preVehicleStrWeiZhi=");
|
||||
|
||||
addPreVehicleModelWeiZhi(TrafficTypeEnum.TYPE_TRAFFIC_ID_PEOPLE, "添加感知模型到地图中……preVehicleStrPeople=");
|
||||
@@ -1038,11 +1053,11 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
.addPreVehicleModel(typeTrafficId.getType(), typeTrafficId.getTraffic3DNightIconId());
|
||||
}
|
||||
|
||||
CallerLogger.INSTANCE.d(M_MAP+TAG, logMsg + preVehicleStrWeiZhi);
|
||||
CallerLogger.INSTANCE.d(M_MAP + TAG, logMsg + preVehicleStrWeiZhi);
|
||||
|
||||
if (preVehicleStrWeiZhi == null) {
|
||||
UiThreadHandler.postDelayed(() -> {
|
||||
CallerLogger.INSTANCE.w(M_MAP+TAG, "添加感知模型到地图中失败,尝试重复添加……");
|
||||
CallerLogger.INSTANCE.w(M_MAP + TAG, "添加感知模型到地图中失败,尝试重复添加……");
|
||||
addPreVehicleModelWeiZhi(typeTrafficId, logMsg);
|
||||
}, 1000L);
|
||||
}
|
||||
|
||||
@@ -59,8 +59,6 @@ dependencies {
|
||||
implementation rootProject.ext.dependencies.arouter
|
||||
kapt rootProject.ext.dependencies.aroutercompiler
|
||||
|
||||
implementation rootProject.ext.dependencies.mogochainbase
|
||||
|
||||
api rootProject.ext.dependencies.mogoaicloudrealtime
|
||||
|
||||
implementation rootProject.ext.dependencies.coroutinesandroid
|
||||
|
||||
Reference in New Issue
Block a user