Merge branch 'dev_robobus-m1-p-app-module_1.0.0_230112_1.0.0' into 'dev_robobus-m1-p-app-module_1.1.0_230112_1.1.0'

Dev robobus m1 p app module 1.0.0 230112 1.0.0

See merge request zhjt/AndroidApp/MoGoEagleEye!626
This commit is contained in:
wangmingjun
2023-02-27 13:01:22 +00:00
83 changed files with 961 additions and 1068 deletions

View File

@@ -192,19 +192,19 @@ class PM2DrivingModel private constructor() {
private val moGoAutopilotPlanningListener = object : IMoGoPlanningRottingListener{
override fun onAutopilotRotting(globalPathResp: MessagePad.GlobalPathResp?) {
val routePoints = globalPathResp?.wayPointsList
if (null != routePoints && routePoints.size > 0) {
updateRoutePoints(routePoints)
// startOrStopRouteAndWipe(true)
globalPathResp?.let {
d(SceneConstant.M_BUS_P + TAG, "och-rotting==wayPointsSize = " + it.wayPointsList.size)
updateRoutePoints(it.wayPointsList)
}
}
}
fun updateRoutePoints(routePoints: List<MessagePad.Location?>?) {
fun updateRoutePoints(routePoints: List<MessagePad.Location>?) {
mRoutePoints.clear()
val latLngModels = CoordinateCalculateRouteUtil
.coordinateConverterWgsToGcjLocations(mContext, routePoints)
d(SceneConstant.M_BUS_P + TAG, "och-rotting==latLngModels = " + latLngModels.size)
mRoutePoints.addAll(latLngModels)
calculateTwoStationsRoute()
}
@@ -336,7 +336,7 @@ class PM2DrivingModel private constructor() {
&& station.isLeaving && i + 1 < stations.size) {
mDrivingInfoCallback?.updateStationsInfo(stations as MutableList<PM2Station>, i + 1, false)
if (mNextStationIndex != i + 1) {
d(SceneConstant.M_BUS_P+TAG,"轨迹排查--开始行程")
d(SceneConstant.M_BUS_P+TAG,"och-rotting--start ")
mTwoStationsRouts.clear()
startRemainRouteInfo()
}
@@ -398,7 +398,7 @@ class PM2DrivingModel private constructor() {
break
}
for (lastPoints in lastPointsMap.values) {
d(SceneConstant.M_BUS_P + TAG, "轨迹排查==lastPoints.size() = " + lastPoints.size)
d(SceneConstant.M_BUS_P + TAG, "och-rotting==lastPoints.size() = " + lastPoints.size)
var lastSumLength = 0f
lastSumLength = if (lastPoints.size == 1) { //只是最后一个点,计算当前位置和最后一个点的距离
if (mNextStationIndex <= mStations.size - 1 && mNextStationIndex >= 0) {
@@ -417,7 +417,7 @@ class PM2DrivingModel private constructor() {
CoordinateCalculateRouteUtil.calculateRouteSumLength(lastPoints)
}
val lastTime = lastSumLength / BusPassengerConst.BUS_AVERAGE_SPEED * 3.6 //秒
d(SceneConstant.M_BUS_P + TAG, "轨迹排查==lastSumLength = $lastSumLength")
d(SceneConstant.M_BUS_P + TAG, "och-rotting==lastSumLength = $lastSumLength")
mDrivingInfoCallback?.updateRemainMT(
lastSumLength.toLong(),
lastTime.toLong()
@@ -447,7 +447,7 @@ class PM2DrivingModel private constructor() {
stationNext.gcjLat
)
d(SceneConstant.M_BUS_P + TAG, "轨迹排查==currentRouteIndex = " + currentRouteIndex
d(SceneConstant.M_BUS_P + TAG, "och-rotting==currentRouteIndex = " + currentRouteIndex
+ " nextRouteIndex = " + nextRouteIndex)
if (currentRouteIndex < nextRouteIndex) { //如果找到的next在起点的轨迹前面直接舍弃这个轨迹不显示

View File

@@ -38,3 +38,15 @@
3. demo: 演示环境(大部分时候都是测试环境)
## 区分 flavor 功能引入
## 不能启动自动驾驶的档位
| 车型 | 配置所在文件 | 档位 | 配置 |
|:-|:-|:-|:-|
| 东风、红旗 | fOchTaxi.gradle、fOchTaxiPassenger.gradle | P、R | buildConfigField 'java.util.Set<chassis.Chassis.GearPosition>', 'UNABLE_LAUNCH_AUTOPILOT_GEAR', 'new java.util.HashSet<chassis.Chassis.GearPosition>(){{add(chassis.Chassis.GearPosition.GEAR_P);add(chassis.Chassis.GearPosition.GEAR_R);}}' |
| 金旅小巴 | fOchBus.gradle、fOchBusPassenger.gradle、fOchShuttle.gradle、fOchShuttlePassenger.gradle | N、R | buildConfigField 'java.util.Set<chassis.Chassis.GearPosition>', 'UNABLE_LAUNCH_AUTOPILOT_GEAR', 'new java.util.HashSet<chassis.Chassis.GearPosition>(){{add(chassis.Chassis.GearPosition.GEAR_N);add(chassis.Chassis.GearPosition.GEAR_R);}}' |
| M1 | fOchBusPassengerM1.gradle | 不限制档位 | buildConfigField 'java.util.Set<chassis.Chassis.GearPosition>', 'UNABLE_LAUNCH_AUTOPILOT_GEAR', 'null' |
| M2 | fOchBusPassengerM2.gradle | N、P、R | buildConfigField 'java.util.Set<chassis.Chassis.GearPosition>', 'UNABLE_LAUNCH_AUTOPILOT_GEAR', 'new java.util.HashSet<chassis.Chassis.GearPosition>(){{add(chassis.Chassis.GearPosition.GEAR_N);add(chassis.Chassis.GearPosition.GEAR_P);add(chassis.Chassis.GearPosition.GEAR_R);}}' |
| 清扫车 | fOchSweeper.gradle | N | buildConfigField 'java.util.Set<chassis.Chassis.GearPosition>', 'UNABLE_LAUNCH_AUTOPILOT_GEAR', 'new java.util.HashSet<chassis.Chassis.GearPosition>(){{add(chassis.Chassis.GearPosition.GEAR_N);}}' |
| 开沃 | 暂无 | 不限制档位 | buildConfigField 'java.util.Set<chassis.Chassis.GearPosition>', 'UNABLE_LAUNCH_AUTOPILOT_GEAR', 'null' |

View File

@@ -45,6 +45,9 @@ project.android.productFlavors {
// 构建 是否支持多屏异显异交互
buildConfigField 'boolean', 'IS_MULTI_DISPLAY', 'true'
//不能启动自驾的档位
buildConfigField 'java.util.Set<chassis.Chassis.GearPosition>', 'UNABLE_LAUNCH_AUTOPILOT_GEAR', 'null'
}
}

View File

@@ -48,6 +48,9 @@ project.android.productFlavors {
// 构建 是否支持多屏异显异交互
buildConfigField 'boolean', 'IS_MULTI_DISPLAY', 'true'
//不能启动自驾的档位
buildConfigField 'java.util.Set<chassis.Chassis.GearPosition>', 'UNABLE_LAUNCH_AUTOPILOT_GEAR', 'null'
}
}

View File

@@ -48,5 +48,8 @@ project.android.productFlavors {
// 构建 是否支持多屏异显异交互
buildConfigField 'boolean', 'IS_MULTI_DISPLAY', 'false'
//Bus不能启动自驾的档位
buildConfigField 'java.util.Set<chassis.Chassis.GearPosition>', 'UNABLE_LAUNCH_AUTOPILOT_GEAR_BUS', 'new java.util.HashSet<chassis.Chassis.GearPosition>(){{add(chassis.Chassis.GearPosition.GEAR_N);add(chassis.Chassis.GearPosition.GEAR_R);}}'
}
}

View File

@@ -44,5 +44,8 @@ project.android.productFlavors {
// 构建 是否支持多屏异显异交互
buildConfigField 'boolean', 'IS_MULTI_DISPLAY', 'false'
//Bus不能启动自驾的档位
buildConfigField 'java.util.Set<chassis.Chassis.GearPosition>', 'UNABLE_LAUNCH_AUTOPILOT_GEAR_BUS', 'new java.util.HashSet<chassis.Chassis.GearPosition>(){{add(chassis.Chassis.GearPosition.GEAR_N);add(chassis.Chassis.GearPosition.GEAR_R);}}'
}
}

View File

@@ -45,5 +45,8 @@ project.android.productFlavors {
// 构建 是否支持多屏异显异交互
buildConfigField 'boolean', 'IS_MULTI_DISPLAY', 'false'
//M2不能启动自驾的档位
buildConfigField 'java.util.Set<chassis.Chassis.GearPosition>', 'UNABLE_LAUNCH_AUTOPILOT_GEAR', 'new java.util.HashSet<chassis.Chassis.GearPosition>(){{add(chassis.Chassis.GearPosition.GEAR_N);add(chassis.Chassis.GearPosition.GEAR_P);add(chassis.Chassis.GearPosition.GEAR_R);}}'
}
}

View File

@@ -46,5 +46,8 @@ project.android.productFlavors {
// 构建 是否支持多屏异显异交互
buildConfigField 'boolean', 'IS_MULTI_DISPLAY', 'false'
//Bus不能启动自驾的档位
buildConfigField 'java.util.Set<chassis.Chassis.GearPosition>', 'UNABLE_LAUNCH_AUTOPILOT_GEAR_BUS', 'new java.util.HashSet<chassis.Chassis.GearPosition>(){{add(chassis.Chassis.GearPosition.GEAR_N);add(chassis.Chassis.GearPosition.GEAR_R);}}'
}
}

View File

@@ -17,7 +17,11 @@ project.android.productFlavors {
// 车机类型主要用于区分自研车机还是别人家的车机自研车机类型为0
buildConfigField 'int', 'CAR_MACHINE_TYPE', '2'
//高德地图鉴权信息
manifestPlaceholders = [AMAP_API_VALUE: rootProject.ext.android.fLauncherAmapApiValue, CHANNEL_VALUE: "fOchShuttlePassenger",ACTIVITY_ROOT:true]
manifestPlaceholders = [AMAP_API_VALUE: rootProject.ext.android.fLauncherAmapApiValue,
CHANNEL_VALUE: "fOchShuttlePassenger",
ACTIVITY_ROOT:true,
// Activity的朝向
SCREEN_ORIENTATION: "landscape"]
// 是否基于地图
buildConfigField 'boolean', 'IS_MAP_BASED', 'true'
@@ -41,5 +45,8 @@ project.android.productFlavors {
// 构建 是否支持多屏异显异交互
buildConfigField 'boolean', 'IS_MULTI_DISPLAY', 'false'
//Bus不能启动自驾的档位
buildConfigField 'java.util.Set<chassis.Chassis.GearPosition>', 'UNABLE_LAUNCH_AUTOPILOT_GEAR', 'new java.util.HashSet<chassis.Chassis.GearPosition>(){{add(chassis.Chassis.GearPosition.GEAR_N);add(chassis.Chassis.GearPosition.GEAR_R);}}'
}
}

View File

@@ -49,5 +49,8 @@ project.android.productFlavors {
// 构建 是否支持多屏异显异交互
buildConfigField 'boolean', 'IS_MULTI_DISPLAY', 'false'
//清扫车不能启动自驾的档位
buildConfigField 'java.util.Set<chassis.Chassis.GearPosition>', 'UNABLE_LAUNCH_AUTOPILOT_GEAR', 'new java.util.HashSet<chassis.Chassis.GearPosition>(){{add(chassis.Chassis.GearPosition.GEAR_N);}}'
}
}

View File

@@ -49,6 +49,9 @@ project.android.productFlavors {
// 构建 是否支持多屏异显异交互
buildConfigField 'boolean', 'IS_MULTI_DISPLAY', 'false'
//Taxi不能启动自驾的档位
buildConfigField 'java.util.Set<chassis.Chassis.GearPosition>', 'UNABLE_LAUNCH_AUTOPILOT_GEAR', 'new java.util.HashSet<chassis.Chassis.GearPosition>(){{add(chassis.Chassis.GearPosition.GEAR_P);add(chassis.Chassis.GearPosition.GEAR_R);}}'
}
}

View File

@@ -48,6 +48,9 @@ project.android.productFlavors {
// 构建 是否支持多屏异显异交互
buildConfigField 'boolean', 'IS_MULTI_DISPLAY', 'true'
//Taxi不能启动自驾的档位
buildConfigField 'java.util.Set<chassis.Chassis.GearPosition>', 'UNABLE_LAUNCH_AUTOPILOT_GEAR', 'new java.util.HashSet<chassis.Chassis.GearPosition>(){{add(chassis.Chassis.GearPosition.GEAR_P);add(chassis.Chassis.GearPosition.GEAR_R);}}'
}
}

View File

@@ -45,5 +45,8 @@ project.android.productFlavors {
// 构建 是否支持多屏异显异交互
buildConfigField 'boolean', 'IS_MULTI_DISPLAY', 'false'
//不能启动自驾的档位
buildConfigField 'java.util.Set<chassis.Chassis.GearPosition>', 'UNABLE_LAUNCH_AUTOPILOT_GEAR', 'null'
}
}

View File

@@ -48,5 +48,8 @@ project.android.productFlavors {
// 构建 是否支持多屏异显异交互
buildConfigField 'boolean', 'IS_MULTI_DISPLAY', 'false'
//M1不能启动自驾的档位
buildConfigField 'java.util.Set<chassis.Chassis.GearPosition>', 'UNABLE_LAUNCH_AUTOPILOT_GEAR', 'null'
}
}

View File

@@ -39,6 +39,8 @@ object ConfigStartUp {
FunctionBuildConfig.appIdentityMode = BuildConfig.APP_IDENTITY_MODE
// 各个module需要的url
FunctionBuildConfig.urlJson = GsonUtils.fromJson(BuildConfig.URLs, UrlConfig::class.java)
//不能启动自动驾驶的档位
FunctionBuildConfig.unableLaunchAutopilotGear = BuildConfig.UNABLE_LAUNCH_AUTOPILOT_GEAR
// // 这里影响当前Activity的身份信息多进程先保持与原来一样主进程为司机端:passenger 进程为乘客端 TODO 暂时不启用,仅做洱海交付,独立乘客屏+宣传视频
// if (ProcessUtils.getCurrentProcessName().contains(":passenger")) {

View File

@@ -64,6 +64,12 @@ android {
driver {
dimension "multi_device"
buildConfigField 'boolean', 'IS_CLIENT', 'false'
buildConfigField 'java.util.Set<chassis.Chassis.GearPosition>', 'UNABLE_LAUNCH_AUTOPILOT_GEAR_TAXI', 'new java.util.HashSet<chassis.Chassis.GearPosition>(){{add(chassis.Chassis.GearPosition.GEAR_P);add(chassis.Chassis.GearPosition.GEAR_R);}}'
buildConfigField 'java.util.Set<chassis.Chassis.GearPosition>', 'UNABLE_LAUNCH_AUTOPILOT_GEAR_BUS', 'new java.util.HashSet<chassis.Chassis.GearPosition>(){{add(chassis.Chassis.GearPosition.GEAR_N);add(chassis.Chassis.GearPosition.GEAR_R);}}'
buildConfigField 'java.util.Set<chassis.Chassis.GearPosition>', 'UNABLE_LAUNCH_AUTOPILOT_GEAR_M1', 'null'
buildConfigField 'java.util.Set<chassis.Chassis.GearPosition>', 'UNABLE_LAUNCH_AUTOPILOT_GEAR_M2', 'new java.util.HashSet<chassis.Chassis.GearPosition>(){{add(chassis.Chassis.GearPosition.GEAR_N);add(chassis.Chassis.GearPosition.GEAR_P);add(chassis.Chassis.GearPosition.GEAR_R);}}'
buildConfigField 'java.util.Set<chassis.Chassis.GearPosition>', 'UNABLE_LAUNCH_AUTOPILOT_GEAR_SWEEPER', 'new java.util.HashSet<chassis.Chassis.GearPosition>(){{add(chassis.Chassis.GearPosition.GEAR_N);}}'
buildConfigField 'java.util.Set<chassis.Chassis.GearPosition>', 'UNABLE_LAUNCH_AUTOPILOT_GEAR_VAN', 'null'
}
}
@@ -94,6 +100,6 @@ dependencies {
// implementation project(':core:mogo-core-utils')
implementation 'org.greenrobot:eventbus:3.2.0'
implementation 'com.android.support:multidex:1.0.3'
implementation 'com.mogo.cloud:telematic:1.3.59'
// implementation 'com.mogo.cloud:telematic:1.3.59'//注释掉司机端 乘客端
implementation 'com.jcraft:jsch:0.1.55'
}

View File

@@ -4,8 +4,13 @@ import android.app.Application;
import com.zhidao.adas.client.utils.CrashHandler;
import chassis.Chassis;
public class App extends Application {
public static App INSTANCE;
public Chassis.GearPosition gear;
@Override
public void onCreate() {
super.onCreate();

View File

@@ -2,36 +2,15 @@ package com.zhidao.adas.client;
import android.util.Pair;
import com.zhidao.adas.client.bean.ArrivalNotification;
import com.zhidao.adas.client.bean.AutopilotState;
import com.zhidao.adas.client.bean.BagManagerCmd;
import com.zhidao.adas.client.bean.BaseInfo;
import com.zhidao.adas.client.bean.BasicInfoReq;
import com.zhidao.adas.client.bean.CarConfigResp;
import com.zhidao.adas.client.bean.ChassisStates;
import com.zhidao.adas.client.bean.DataShow;
import com.zhidao.adas.client.bean.ErrorData;
import com.zhidao.adas.client.bean.FSMFunctionStates;
import com.zhidao.adas.client.bean.GlobalPathResp;
import com.zhidao.adas.client.bean.GnssInfo;
import com.zhidao.adas.client.bean.MogoReportMessage;
import com.zhidao.adas.client.bean.ObuMap;
import com.zhidao.adas.client.bean.ObuRsi;
import com.zhidao.adas.client.bean.ObuRsm;
import com.zhidao.adas.client.bean.ObuSpat;
import com.zhidao.adas.client.bean.OriginalPointCloudData;
import com.zhidao.adas.client.bean.PerceptionTrafficLight;
import com.zhidao.adas.client.bean.PlanningDecisionState;
import com.zhidao.adas.client.bean.PlanningObjects;
import com.zhidao.adas.client.bean.PredictionObstacleTrajectory;
import com.zhidao.adas.client.bean.RecordDataConfig;
import com.zhidao.adas.client.bean.RecordPanel;
import com.zhidao.adas.client.bean.RoboSweeperTaskIndex;
import com.zhidao.adas.client.bean.StatusInfo;
import com.zhidao.adas.client.bean.TrackedObjects;
import com.zhidao.adas.client.bean.Trajectory;
import com.zhidao.adas.client.bean.VehicleState;
import com.zhidao.adas.client.bean.Warn;
import com.zhidao.adas.client.log.LogSave;
import com.zhidao.adas.client.utils.Constants;
import com.zhidao.support.adas.high.common.ThreadPoolManager;
@@ -44,6 +23,8 @@ import java.util.Locale;
import java.util.concurrent.Future;
import java.util.concurrent.LinkedBlockingQueue;
import mogo.telematics.pad.MessagePad;
/**
* 数据分发
*/
@@ -193,8 +174,8 @@ public class DataDistribution {
}
public String cutDown(String str) {
if (isCutDown && str.length() > 650) {
str = str.substring(0, 650) + "\n已缩短。如需查看完整数据请勾选日志缩短复选框";
if (isCutDown && str.length() > 850) {
str = str.substring(0, 850) + "\n已缩短。如需查看完整数据请勾选日志缩短复选框";
}
return str;
}
@@ -202,219 +183,222 @@ public class DataDistribution {
private String onTransmit(String time, BaseInfo data) {
String temp = data.toString();
String str = cutDown(temp);
if (data instanceof Trajectory) {
listTrajectory.add(0, new DataShow(listTrajectorySize++, time + str));
if (listTrajectory.size() > LIST_SIZE) {
listTrajectory.remove(listTrajectory.size() - 1);
if (data.header == null) {
if (data instanceof ErrorData) {
listErrorData.add(0, new DataShow(listErrorDataSize++, time + str));
if (listErrorData.size() > 100) {
listErrorData.remove(listErrorData.size() - 1);
}
if (listener != null && Constants.TITLE.RECEIVE_ERROR.equals(listener.first)) {
listener.second.onRefresh();
}
} else if (data instanceof OriginalPointCloudData) {
listOriginalPointCloud.add(0, new DataShow(listOriginalPointCloudSize++, time + str));
if (listOriginalPointCloud.size() > LIST_SIZE) {
listOriginalPointCloud.remove(listOriginalPointCloud.size() - 1);
}
if (listener != null && Constants.TITLE.RECEIVE_POINT_CLOUD_ORIGINAL.equals(listener.first)) {
listener.second.onRefresh();
}
}
if (listener != null && Constants.TITLE.RECEIVE_TRAJECTORY.equals(listener.first)) {
listener.second.onRefresh();
}
} else if (data instanceof TrackedObjects) {
listTrackedObjects.add(0, new DataShow(listTrackedObjectsSize++, time + str));
if (listTrackedObjects.size() > LIST_SIZE) {
listTrackedObjects.remove(listTrackedObjects.size() - 1);
}
if (listener != null && Constants.TITLE.RECEIVE_TRACKED_OBJECTS.equals(listener.first)) {
listener.second.onRefresh();
}
} else if (data instanceof OriginalPointCloudData) {
listOriginalPointCloud.add(0, new DataShow(listOriginalPointCloudSize++, time + str));
if (listOriginalPointCloud.size() > LIST_SIZE) {
listOriginalPointCloud.remove(listOriginalPointCloud.size() - 1);
}
if (listener != null && Constants.TITLE.RECEIVE_POINT_CLOUD_ORIGINAL.equals(listener.first)) {
listener.second.onRefresh();
}
} else if (data instanceof PlanningObjects) {
listPlanningObjects.add(0, new DataShow(listPlanningObjectsSize++, time + str));
if (listPlanningObjects.size() > LIST_SIZE) {
listPlanningObjects.remove(listPlanningObjects.size() - 1);
}
if (listener != null && Constants.TITLE.RECEIVE_PLANNING_OBJECTS.equals(listener.first)) {
listener.second.onRefresh();
}
} else if (data instanceof PlanningDecisionState) {
listPlanningDecisionState.add(0, new DataShow(listPlanningDecisionStateSize++, time + str));
if (listPlanningDecisionState.size() > LIST_SIZE) {
listPlanningDecisionState.remove(listPlanningDecisionState.size() - 1);
}
if (listener != null && Constants.TITLE.RECEIVE_PLANNING_DECISION_STATE.equals(listener.first)) {
listener.second.onRefresh();
}
} else if (data instanceof ObuSpat) {
listObuSpat.add(0, new DataShow(listObuSpatSize++, time + str));
if (listObuSpat.size() > LIST_SIZE) {
listObuSpat.remove(listObuSpat.size() - 1);
}
if (listener != null && Constants.TITLE.RECEIVE_OBU_SPAT.equals(listener.first)) {
listener.second.onRefresh();
}
} else if (data instanceof ObuRsi) {
listObuRsi.add(0, new DataShow(listObuRsiSize++, time + str));
if (listObuRsi.size() > LIST_SIZE) {
listObuRsi.remove(listObuRsi.size() - 1);
}
if (listener != null && Constants.TITLE.RECEIVE_OBU_RSI.equals(listener.first)) {
listener.second.onRefresh();
}
} else if (data instanceof ObuRsm) {
listObuRsm.add(0, new DataShow(listObuRsmSize++, time + str));
if (listObuRsm.size() > LIST_SIZE) {
listObuRsm.remove(listObuRsm.size() - 1);
}
if (listener != null && Constants.TITLE.RECEIVE_OBU_RSM.equals(listener.first)) {
listener.second.onRefresh();
}
} else if (data instanceof ObuMap) {
listObuMap.add(0, new DataShow(listObuMapSize++, time + str));
if (listObuMap.size() > LIST_SIZE) {
listObuMap.remove(listObuMap.size() - 1);
}
if (listener != null && Constants.TITLE.RECEIVE_OBU_MAP.equals(listener.first)) {
listener.second.onRefresh();
}
} else if (data instanceof GnssInfo) {
listGnssInfo.add(0, new DataShow(listGnssInfoSize++, time + str));
if (listGnssInfo.size() > LIST_SIZE) {
listGnssInfo.remove(listGnssInfo.size() - 1);
}
if (listener != null && Constants.TITLE.RECEIVE_GNSS_INFO.equals(listener.first)) {
listener.second.onRefresh();
}
} else if (data instanceof VehicleState) {
listVehicleState.add(0, new DataShow(listVehicleStateSize++, time + str));
if (listVehicleState.size() > LIST_SIZE) {
listVehicleState.remove(listVehicleState.size() - 1);
}
if (listener != null && Constants.TITLE.RECEIVE_VEHICLE_STATE.equals(listener.first)) {
listener.second.onRefresh();
}
} else if (data instanceof ChassisStates) {
listChassisStates.add(0, new DataShow(listChassisStatesSize++, time + str));
if (listChassisStates.size() > LIST_SIZE) {
listChassisStates.remove(listChassisStates.size() - 1);
}
if (listener != null && Constants.TITLE.RECEIVE_CHASSIS_STATES.equals(listener.first)) {
listener.second.onRefresh();
}
} else if (data instanceof AutopilotState) {
listAutopilotState.add(0, new DataShow(listAutopilotStateSize++, time + str));
if (listAutopilotState.size() > LIST_SIZE) {
listAutopilotState.remove(listAutopilotState.size() - 1);
}
if (listener != null && Constants.TITLE.RECEIVE_AUTOPILOT_STATE.equals(listener.first)) {
listener.second.onRefresh();
}
} else if (data instanceof MogoReportMessage) {
listMogoReportMessage.add(0, new DataShow(listMogoReportMessageSize++, time + str));
if (listMogoReportMessage.size() > LIST_SIZE) {
listMogoReportMessage.remove(listMogoReportMessage.size() - 1);
}
if (listener != null && Constants.TITLE.RECEIVE_REPORT_MESSAGE.equals(listener.first)) {
listener.second.onRefresh();
}
} else if (data instanceof PerceptionTrafficLight) {
listPerceptionTrafficLight.add(0, new DataShow(listPerceptionTrafficLightSize++, time + str));
if (listPerceptionTrafficLight.size() > LIST_SIZE) {
listPerceptionTrafficLight.remove(listPerceptionTrafficLight.size() - 1);
}
if (listener != null && Constants.TITLE.RECEIVE_PERCEPTION_TRAFFIC_LIGHT.equals(listener.first)) {
listener.second.onPerceptionTrafficLight((PerceptionTrafficLight) data);
}
} else if (data instanceof PredictionObstacleTrajectory) {
listPredictionObstacleTrajectory.add(0, new DataShow(listPredictionObstacleTrajectorySize++, time + str));
if (listPredictionObstacleTrajectory.size() > LIST_SIZE) {
listPredictionObstacleTrajectory.remove(listPredictionObstacleTrajectory.size() - 1);
}
if (listener != null && Constants.TITLE.RECEIVE_PREDICTION_OBSTACLE_TRAJECTORY.equals(listener.first)) {
listener.second.onRefresh();
}
} else if (data instanceof BasicInfoReq) {
} else if (data instanceof CarConfigResp) {
if (listener != null && Constants.TITLE.TITLE_CAR_CONFIG_RESP.equals(listener.first)) {
listener.second.onRefresh();
}
} else if (data instanceof RecordPanel) {
listRecordPanel.add(0, new DataShow(listRecordPanelSize++, time + str));
if (listRecordPanel.size() > LIST_SIZE) {
listRecordPanel.remove(listRecordPanel.size() - 1);
}
if (listener != null && Constants.TITLE.RECEIVE_RECORD_RESULT.equals(listener.first)) {
listener.second.onRefresh();
}
} else if (data instanceof BagManagerCmd) {
listBagManagerCmd.add(0, new DataShow(listBagManagerCmdSize++, time + str));
if (listBagManagerCmd.size() > LIST_SIZE) {
listBagManagerCmd.remove(listBagManagerCmd.size() - 1);
}
if (listener != null && Constants.TITLE.RECEIVE_BAG_MANAGER_CMD.equals(listener.first)) {
listener.second.onRefresh();
}
} else if (data instanceof GlobalPathResp) {
listGlobalPathResp.add(0, new DataShow(listGlobalPathRespSize++, time + str));
if (listGlobalPathResp.size() > LIST_SIZE) {
listGlobalPathResp.remove(listGlobalPathResp.size() - 1);
}
if (listener != null && Constants.TITLE.RECEIVE_GLOBAL_PATH_RESP.equals(listener.first)) {
listener.second.onRefresh();
}
} else if (data instanceof Warn) {
listWarn.add(0, new DataShow(listWarnSize++, time + str));
if (listWarn.size() > LIST_SIZE) {
listWarn.remove(listWarn.size() - 1);
}
if (listener != null && Constants.TITLE.RECEIVE_WARN.equals(listener.first)) {
listener.second.onRefresh();
}
} else if (data instanceof ArrivalNotification) {
listArrivalNotification.add(0, new DataShow(listArrivalNotificationSize++, time + str));
if (listArrivalNotification.size() > LIST_SIZE) {
listArrivalNotification.remove(listArrivalNotification.size() - 1);
}
if (listener != null && Constants.TITLE.RECEIVE_ARRIVAL_NOTIFICATION.equals(listener.first)) {
listener.second.onRefresh();
}
} else if (data instanceof StatusInfo) {
listStatusInfo.add(0, new DataShow(listStatusInfoSize++, time + str));
if (listStatusInfo.size() > LIST_SIZE) {
listStatusInfo.remove(listStatusInfo.size() - 1);
}
if (listener != null && Constants.TITLE.RECEIVE_STATUS_QUERY_RESP.equals(listener.first)) {
listener.second.onRefresh();
}
} else if (data instanceof RecordDataConfig) {
listRecordDataConfig.add(0, new DataShow(listRecordDataConfigSize++, time + str));
if (listRecordDataConfig.size() > LIST_SIZE) {
listRecordDataConfig.remove(listRecordDataConfig.size() - 1);
}
if (listener != null && Constants.TITLE.RECEIVE_RECORD_DATA_CONFIG_RESP.equals(listener.first)) {
listener.second.onRefresh();
}
} else if (data instanceof RoboSweeperTaskIndex) {
listRoboSweeperTaskIndex.add(0, new DataShow(listRoboSweeperTaskIndexSize++, time + str));
if (listRoboSweeperTaskIndex.size() > LIST_SIZE) {
listRoboSweeperTaskIndex.remove(listRoboSweeperTaskIndex.size() - 1);
}
if (listener != null && Constants.TITLE.RECEIVE_SWEEPER_TASK_INDEX_DATA.equals(listener.first)) {
listener.second.onRefresh();
}
} else if (data instanceof FSMFunctionStates) {
listFSMFunctionStates.add(0, new DataShow(listFSMFunctionStatesSize++, time + str));
if (listFSMFunctionStates.size() > LIST_SIZE) {
listFSMFunctionStates.remove(listFSMFunctionStates.size() - 1);
}
if (listener != null && Constants.TITLE.RECEIVE_FUNCTION_STATES.equals(listener.first)) {
listener.second.onRefresh();
}
} else if (data instanceof ErrorData) {
listErrorData.add(0, new DataShow(listErrorDataSize++, time + str));
if (listErrorData.size() > 100) {
listErrorData.remove(listErrorData.size() - 1);
}
if (listener != null && Constants.TITLE.RECEIVE_ERROR.equals(listener.first)) {
listener.second.onRefresh();
} else {
MessagePad.MessageType messageType = data.header.getMsgType();
if (messageType == MessagePad.MessageType.MsgTypeTrajectory) {
listTrajectory.add(0, new DataShow(listTrajectorySize++, time + str));
if (listTrajectory.size() > LIST_SIZE) {
listTrajectory.remove(listTrajectory.size() - 1);
}
if (listener != null && Constants.TITLE.RECEIVE_TRAJECTORY.equals(listener.first)) {
listener.second.onRefresh();
}
} else if (messageType == MessagePad.MessageType.MsgTypeTrackedObjects) {
listTrackedObjects.add(0, new DataShow(listTrackedObjectsSize++, time + str));
if (listTrackedObjects.size() > LIST_SIZE) {
listTrackedObjects.remove(listTrackedObjects.size() - 1);
}
if (listener != null && Constants.TITLE.RECEIVE_TRACKED_OBJECTS.equals(listener.first)) {
listener.second.onRefresh();
}
} else if (messageType == MessagePad.MessageType.MsgTypePlanningObjects) {
listPlanningObjects.add(0, new DataShow(listPlanningObjectsSize++, time + str));
if (listPlanningObjects.size() > LIST_SIZE) {
listPlanningObjects.remove(listPlanningObjects.size() - 1);
}
if (listener != null && Constants.TITLE.RECEIVE_PLANNING_OBJECTS.equals(listener.first)) {
listener.second.onRefresh();
}
} else if (messageType == MessagePad.MessageType.MsgTypePlanningDecisionState) {
listPlanningDecisionState.add(0, new DataShow(listPlanningDecisionStateSize++, time + str));
if (listPlanningDecisionState.size() > LIST_SIZE) {
listPlanningDecisionState.remove(listPlanningDecisionState.size() - 1);
}
if (listener != null && Constants.TITLE.RECEIVE_PLANNING_DECISION_STATE.equals(listener.first)) {
listener.second.onRefresh();
}
} else if (messageType == MessagePad.MessageType.MsgTypeGnssInfo) {
listGnssInfo.add(0, new DataShow(listGnssInfoSize++, time + str));
if (listGnssInfo.size() > LIST_SIZE) {
listGnssInfo.remove(listGnssInfo.size() - 1);
}
if (listener != null && Constants.TITLE.RECEIVE_GNSS_INFO.equals(listener.first)) {
listener.second.onRefresh();
}
} else if (messageType == MessagePad.MessageType.MsgTypeVehicleState) {
listVehicleState.add(0, new DataShow(listVehicleStateSize++, time + str));
if (listVehicleState.size() > LIST_SIZE) {
listVehicleState.remove(listVehicleState.size() - 1);
}
if (listener != null && Constants.TITLE.RECEIVE_VEHICLE_STATE.equals(listener.first)) {
listener.second.onRefresh();
}
} else if (messageType == MessagePad.MessageType.MsgTypeChassisStates) {
listChassisStates.add(0, new DataShow(listChassisStatesSize++, time + str));
if (listChassisStates.size() > LIST_SIZE) {
listChassisStates.remove(listChassisStates.size() - 1);
}
if (listener != null && Constants.TITLE.RECEIVE_CHASSIS_STATES.equals(listener.first)) {
listener.second.onRefresh();
}
} else if (messageType == MessagePad.MessageType.MsgTypeAutopilotState) {
listAutopilotState.add(0, new DataShow(listAutopilotStateSize++, time + str));
if (listAutopilotState.size() > LIST_SIZE) {
listAutopilotState.remove(listAutopilotState.size() - 1);
}
if (listener != null && Constants.TITLE.RECEIVE_AUTOPILOT_STATE.equals(listener.first)) {
listener.second.onRefresh();
}
} else if (messageType == MessagePad.MessageType.MsgTypeReportMessage) {
listMogoReportMessage.add(0, new DataShow(listMogoReportMessageSize++, time + str));
if (listMogoReportMessage.size() > LIST_SIZE) {
listMogoReportMessage.remove(listMogoReportMessage.size() - 1);
}
if (listener != null && Constants.TITLE.RECEIVE_REPORT_MESSAGE.equals(listener.first)) {
listener.second.onRefresh();
}
} else if (messageType == MessagePad.MessageType.MsgTypePredictionObstacleTrajectory) {
listPredictionObstacleTrajectory.add(0, new DataShow(listPredictionObstacleTrajectorySize++, time + str));
if (listPredictionObstacleTrajectory.size() > LIST_SIZE) {
listPredictionObstacleTrajectory.remove(listPredictionObstacleTrajectory.size() - 1);
}
if (listener != null && Constants.TITLE.RECEIVE_PREDICTION_OBSTACLE_TRAJECTORY.equals(listener.first)) {
listener.second.onRefresh();
}
} else if (messageType == MessagePad.MessageType.MsgTypeCarConfigResp) {
if (listener != null && Constants.TITLE.TITLE_CAR_CONFIG_RESP.equals(listener.first)) {
listener.second.onRefresh();
}
} else if (messageType == MessagePad.MessageType.MsgTypeRecordResult) {
listRecordPanel.add(0, new DataShow(listRecordPanelSize++, time + str));
if (listRecordPanel.size() > LIST_SIZE) {
listRecordPanel.remove(listRecordPanel.size() - 1);
}
if (listener != null && Constants.TITLE.RECEIVE_RECORD_RESULT.equals(listener.first)) {
listener.second.onRefresh();
}
} else if (messageType == MessagePad.MessageType.MsgTypeBagManagerCmd) {
listBagManagerCmd.add(0, new DataShow(listBagManagerCmdSize++, time + str));
if (listBagManagerCmd.size() > LIST_SIZE) {
listBagManagerCmd.remove(listBagManagerCmd.size() - 1);
}
if (listener != null && Constants.TITLE.RECEIVE_BAG_MANAGER_CMD.equals(listener.first)) {
listener.second.onRefresh();
}
} else if (messageType == MessagePad.MessageType.MsgTypeGlobalPathResp) {
listGlobalPathResp.add(0, new DataShow(listGlobalPathRespSize++, time + str));
if (listGlobalPathResp.size() > LIST_SIZE) {
listGlobalPathResp.remove(listGlobalPathResp.size() - 1);
}
if (listener != null && Constants.TITLE.RECEIVE_GLOBAL_PATH_RESP.equals(listener.first)) {
listener.second.onRefresh();
}
} else if (messageType == MessagePad.MessageType.MsgTypeWarn) {
listWarn.add(0, new DataShow(listWarnSize++, time + str));
if (listWarn.size() > LIST_SIZE) {
listWarn.remove(listWarn.size() - 1);
}
if (listener != null && Constants.TITLE.RECEIVE_WARN.equals(listener.first)) {
listener.second.onRefresh();
}
} else if (messageType == MessagePad.MessageType.MsgTypeArrivalNotification) {
listArrivalNotification.add(0, new DataShow(listArrivalNotificationSize++, time + str));
if (listArrivalNotification.size() > LIST_SIZE) {
listArrivalNotification.remove(listArrivalNotification.size() - 1);
}
if (listener != null && Constants.TITLE.RECEIVE_ARRIVAL_NOTIFICATION.equals(listener.first)) {
listener.second.onRefresh();
}
} else if (messageType == MessagePad.MessageType.MsgTypeStatusQueryResp) {
listStatusInfo.add(0, new DataShow(listStatusInfoSize++, time + str));
if (listStatusInfo.size() > LIST_SIZE) {
listStatusInfo.remove(listStatusInfo.size() - 1);
}
if (listener != null && Constants.TITLE.RECEIVE_STATUS_QUERY_RESP.equals(listener.first)) {
listener.second.onRefresh();
}
} else if (messageType == MessagePad.MessageType.MsgTypeRecordDataConfigResp) {
listRecordDataConfig.add(0, new DataShow(listRecordDataConfigSize++, time + str));
if (listRecordDataConfig.size() > LIST_SIZE) {
listRecordDataConfig.remove(listRecordDataConfig.size() - 1);
}
if (listener != null && Constants.TITLE.RECEIVE_RECORD_DATA_CONFIG_RESP.equals(listener.first)) {
listener.second.onRefresh();
}
} else if (messageType == MessagePad.MessageType.MsgTypeSweeperTaskIndexData) {
listRoboSweeperTaskIndex.add(0, new DataShow(listRoboSweeperTaskIndexSize++, time + str));
if (listRoboSweeperTaskIndex.size() > LIST_SIZE) {
listRoboSweeperTaskIndex.remove(listRoboSweeperTaskIndex.size() - 1);
}
if (listener != null && Constants.TITLE.RECEIVE_SWEEPER_TASK_INDEX_DATA.equals(listener.first)) {
listener.second.onRefresh();
}
} else if (messageType == MessagePad.MessageType.MsgTypeFunctionStates) {
listFSMFunctionStates.add(0, new DataShow(listFSMFunctionStatesSize++, time + str));
if (listFSMFunctionStates.size() > LIST_SIZE) {
listFSMFunctionStates.remove(listFSMFunctionStates.size() - 1);
}
if (listener != null && Constants.TITLE.RECEIVE_FUNCTION_STATES.equals(listener.first)) {
listener.second.onRefresh();
}
} else if (data instanceof PerceptionTrafficLight) {
listPerceptionTrafficLight.add(0, new DataShow(listPerceptionTrafficLightSize++, time + str));
if (listPerceptionTrafficLight.size() > LIST_SIZE) {
listPerceptionTrafficLight.remove(listPerceptionTrafficLight.size() - 1);
}
if (listener != null && Constants.TITLE.RECEIVE_PERCEPTION_TRAFFIC_LIGHT.equals(listener.first)) {
listener.second.onPerceptionTrafficLight((PerceptionTrafficLight) data);
}
} else if (data instanceof ObuSpat) {
listObuSpat.add(0, new DataShow(listObuSpatSize++, time + str));
if (listObuSpat.size() > LIST_SIZE) {
listObuSpat.remove(listObuSpat.size() - 1);
}
if (listener != null && Constants.TITLE.RECEIVE_OBU_SPAT.equals(listener.first)) {
listener.second.onRefresh();
}
} else if (data instanceof ObuRsi) {
listObuRsi.add(0, new DataShow(listObuRsiSize++, time + str));
if (listObuRsi.size() > LIST_SIZE) {
listObuRsi.remove(listObuRsi.size() - 1);
}
if (listener != null && Constants.TITLE.RECEIVE_OBU_RSI.equals(listener.first)) {
listener.second.onRefresh();
}
} else if (data instanceof ObuRsm) {
listObuRsm.add(0, new DataShow(listObuRsmSize++, time + str));
if (listObuRsm.size() > LIST_SIZE) {
listObuRsm.remove(listObuRsm.size() - 1);
}
if (listener != null && Constants.TITLE.RECEIVE_OBU_RSM.equals(listener.first)) {
listener.second.onRefresh();
}
} else if (data instanceof ObuMap) {
listObuMap.add(0, new DataShow(listObuMapSize++, time + str));
if (listObuMap.size() > LIST_SIZE) {
listObuMap.remove(listObuMap.size() - 1);
}
if (listener != null && Constants.TITLE.RECEIVE_OBU_MAP.equals(listener.first)) {
listener.second.onRefresh();
}
}
}
return temp;

View File

@@ -1,23 +0,0 @@
package com.zhidao.adas.client.bean;
import com.google.protobuf.TextFormat;
import java.text.SimpleDateFormat;
import mogo.telematics.pad.MessagePad;
public class ArrivalNotification extends BaseInfo {
public final MessagePad.ArrivalNotification bean;
public ArrivalNotification(MessagePad.Header header, MessagePad.ArrivalNotification bean, SimpleDateFormat sdf) {
super("接收", bean.getSerializedSize(), header, sdf);
this.bean = bean;
}
@Override
public String toString() {
return super.toString() + TextFormat.printer().escapingNonAscii(false).printToString(bean);
}
}

View File

@@ -1,24 +0,0 @@
package com.zhidao.adas.client.bean;
import com.google.protobuf.TextFormat;
import java.text.SimpleDateFormat;
import mogo.telematics.pad.MessagePad;
public class AutopilotState extends BaseInfo {
public final MessagePad.AutopilotState bean;
public AutopilotState(MessagePad.Header header, MessagePad.AutopilotState bean, SimpleDateFormat sdf) {
super("接收", bean.getSerializedSize(), header, sdf);
this.bean = bean;
}
@Override
public String toString() {
return super.toString() + TextFormat.printer().escapingNonAscii(false).printToString(bean);
}
}

View File

@@ -1,24 +0,0 @@
package com.zhidao.adas.client.bean;
import com.google.protobuf.TextFormat;
import java.text.SimpleDateFormat;
import bag_manager.BagManagerOuterClass;
import mogo.telematics.pad.MessagePad;
public class BagManagerCmd extends BaseInfo {
public final BagManagerOuterClass.BagManager bean;
public BagManagerCmd(MessagePad.Header header, BagManagerOuterClass.BagManager bean, SimpleDateFormat sdf) {
super("接收", bean.getSerializedSize(), header, sdf);
this.bean = bean;
}
@Override
public String toString() {
return super.toString() + TextFormat.printer().escapingNonAscii(false).printToString(bean);
}
}

View File

@@ -1,23 +0,0 @@
package com.zhidao.adas.client.bean;
import com.google.protobuf.TextFormat;
import java.text.SimpleDateFormat;
import mogo.telematics.pad.MessagePad;
public class BasicInfoReq extends BaseInfo {
public final MessagePad.BasicInfoReq bean;
public BasicInfoReq(MessagePad.Header header, MessagePad.BasicInfoReq bean, SimpleDateFormat sdf) {
super("接收", bean.getSerializedSize(), header, sdf);
this.bean = bean;
}
@Override
public String toString() {
return super.toString() + TextFormat.printer().escapingNonAscii(false).printToString(bean);
}
}

View File

@@ -1,23 +0,0 @@
package com.zhidao.adas.client.bean;
import com.google.protobuf.TextFormat;
import java.text.SimpleDateFormat;
import mogo.telematics.pad.MessagePad;
public class CarConfigResp extends BaseInfo {
public final MessagePad.CarConfigResp bean;
public CarConfigResp(MessagePad.Header header, MessagePad.CarConfigResp bean, SimpleDateFormat sdf) {
super("接收", bean.getSerializedSize(), header, sdf);
this.bean = bean;
}
@Override
public String toString() {
return super.toString() + TextFormat.printer().escapingNonAscii(false).printToString(bean);
}
}

View File

@@ -1,24 +0,0 @@
package com.zhidao.adas.client.bean;
import com.google.protobuf.TextFormat;
import java.text.SimpleDateFormat;
import chassis.ChassisStatesOuterClass;
import mogo.telematics.pad.MessagePad;
public class ChassisStates extends BaseInfo {
public final ChassisStatesOuterClass.ChassisStates bean;
public ChassisStates(MessagePad.Header header, ChassisStatesOuterClass.ChassisStates bean, SimpleDateFormat sdf) {
super("接收", bean.getSerializedSize(), header, sdf);
this.bean = bean;
}
@Override
public String toString() {
return super.toString() + TextFormat.printer().escapingNonAscii(false).printToString(bean);
}
}

View File

@@ -1,24 +0,0 @@
package com.zhidao.adas.client.bean;
import com.google.protobuf.TextFormat;
import java.text.SimpleDateFormat;
import function_state_management.FunctionStates;
import mogo.telematics.pad.MessagePad;
public class FSMFunctionStates extends BaseInfo {
public final FunctionStates.FSMFunctionStates bean;
public FSMFunctionStates(MessagePad.Header header, FunctionStates.FSMFunctionStates bean, SimpleDateFormat sdf) {
super("接收", bean.getSerializedSize(), header, sdf);
this.bean = bean;
}
@Override
public String toString() {
return super.toString() + TextFormat.printer().escapingNonAscii(false).printToString(bean);
}
}

View File

@@ -1,23 +0,0 @@
package com.zhidao.adas.client.bean;
import com.google.protobuf.TextFormat;
import java.text.SimpleDateFormat;
import mogo.telematics.pad.MessagePad;
public class GlobalPathResp extends BaseInfo {
public final MessagePad.GlobalPathResp bean;
public GlobalPathResp(MessagePad.Header header, MessagePad.GlobalPathResp bean, SimpleDateFormat sdf) {
super("接收", bean.getSerializedSize(), header, sdf);
this.bean = bean;
}
@Override
public String toString() {
return super.toString() + TextFormat.printer().escapingNonAscii(false).printToString(bean);
}
}

View File

@@ -1,24 +0,0 @@
package com.zhidao.adas.client.bean;
import com.google.protobuf.TextFormat;
import java.text.SimpleDateFormat;
import mogo.telematics.pad.MessagePad;
public class GnssInfo extends BaseInfo {
public final MessagePad.GnssInfo bean;
public GnssInfo(MessagePad.Header header, MessagePad.GnssInfo bean, SimpleDateFormat sdf) {
super("接收", bean.getSerializedSize(), header, sdf);
this.bean = bean;
}
@Override
public String toString() {
return super.toString() + TextFormat.printer().escapingNonAscii(false).printToString(bean);
}
}

View File

@@ -1,25 +0,0 @@
package com.zhidao.adas.client.bean;
import com.google.protobuf.TextFormat;
import java.text.SimpleDateFormat;
import mogo.telematics.pad.MessagePad;
import mogo_msg.MogoReportMsg;
public class MogoReportMessage extends BaseInfo {
public final MogoReportMsg.MogoReportMessage bean;
public MogoReportMessage(MessagePad.Header header, MogoReportMsg.MogoReportMessage bean, SimpleDateFormat sdf) {
super("接收", bean.getSerializedSize(), header, sdf);
this.bean = bean;
}
@Override
public String toString() {
return super.toString() + TextFormat.printer().escapingNonAscii(false).printToString(bean);
}
}

View File

@@ -2,6 +2,7 @@ package com.zhidao.adas.client.bean;
import com.google.protobuf.TextFormat;
import com.mogo.support.obu.ObuScene;
import com.zhidao.support.adas.high.common.ByteUtil;
import java.text.SimpleDateFormat;
@@ -18,7 +19,7 @@ public class ObuMap extends BaseInfo {
@Override
public String toString() {
return super.toString() + TextFormat.printer().escapingNonAscii(false).printToString(bean);
return super.toString() + "Payload原始数据" + ByteUtil.byteArrToHex(bean.toByteArray()) + '\n' + TextFormat.printer().escapingNonAscii(false).printToString(bean);
}
}

View File

@@ -2,6 +2,7 @@ package com.zhidao.adas.client.bean;
import com.google.protobuf.TextFormat;
import com.mogo.support.obu.ObuScene;
import com.zhidao.support.adas.high.common.ByteUtil;
import java.text.SimpleDateFormat;
@@ -18,7 +19,7 @@ public class ObuRsi extends BaseInfo {
@Override
public String toString() {
return super.toString() + TextFormat.printer().escapingNonAscii(false).printToString(bean);
return super.toString() + "Payload原始数据" + ByteUtil.byteArrToHex(bean.toByteArray()) + '\n' + TextFormat.printer().escapingNonAscii(false).printToString(bean);
}
}

View File

@@ -2,6 +2,7 @@ package com.zhidao.adas.client.bean;
import com.google.protobuf.TextFormat;
import com.mogo.support.obu.ObuScene;
import com.zhidao.support.adas.high.common.ByteUtil;
import java.text.SimpleDateFormat;
@@ -18,7 +19,7 @@ public class ObuRsm extends BaseInfo {
@Override
public String toString() {
return super.toString() + TextFormat.printer().escapingNonAscii(false).printToString(bean);
return super.toString() + "Payload原始数据" + ByteUtil.byteArrToHex(bean.toByteArray()) + '\n' + TextFormat.printer().escapingNonAscii(false).printToString(bean);
}
}

View File

@@ -2,6 +2,7 @@ package com.zhidao.adas.client.bean;
import com.google.protobuf.TextFormat;
import com.mogo.support.obu.ObuScene;
import com.zhidao.support.adas.high.common.ByteUtil;
import java.text.SimpleDateFormat;
@@ -18,7 +19,7 @@ public class ObuSpat extends BaseInfo {
@Override
public String toString() {
return super.toString() + TextFormat.printer().escapingNonAscii(false).printToString(bean);
return super.toString() + "Payload原始数据" + ByteUtil.byteArrToHex(bean.toByteArray()) + '\n' + TextFormat.printer().escapingNonAscii(false).printToString(bean);
}
}

View File

@@ -1,24 +0,0 @@
package com.zhidao.adas.client.bean;
import com.google.protobuf.TextFormat;
import java.text.SimpleDateFormat;
import mogo.telematics.pad.MessagePad;
import mogo.v2x.ObuWarningEvent;
public class ObuWarningData extends BaseInfo {
public final ObuWarningEvent.ObuWarningData bean;
public ObuWarningData(MessagePad.Header header, ObuWarningEvent.ObuWarningData bean, SimpleDateFormat sdf) {
super("接收", bean.getSerializedSize(), header, sdf);
this.bean = bean;
}
@Override
public String toString() {
return super.toString() + TextFormat.printer().escapingNonAscii(false).printToString(bean);
}
}

View File

@@ -1,6 +1,7 @@
package com.zhidao.adas.client.bean;
import com.google.protobuf.TextFormat;
import com.zhidao.support.adas.high.common.ByteUtil;
import java.text.SimpleDateFormat;
@@ -18,7 +19,7 @@ public class PerceptionTrafficLight extends BaseInfo {
@Override
public String toString() {
return super.toString() + TextFormat.printer().escapingNonAscii(false).printToString(bean);
return super.toString() + "Payload原始数据" + ByteUtil.byteArrToHex(bean.toByteArray()) + '\n' + TextFormat.printer().escapingNonAscii(false).printToString(bean);
}
}

View File

@@ -1,23 +0,0 @@
package com.zhidao.adas.client.bean;
import com.google.protobuf.TextFormat;
import java.text.SimpleDateFormat;
import mogo.telematics.pad.MessagePad;
public class PlanningDecisionState extends BaseInfo {
public final MessagePad.PlanningActionMsg bean;
public PlanningDecisionState(MessagePad.Header header, MessagePad.PlanningActionMsg bean, SimpleDateFormat sdf) {
super("接收", bean.getSerializedSize(), header, sdf);
this.bean = bean;
}
@Override
public String toString() {
return super.toString() + TextFormat.printer().escapingNonAscii(false).printToString(bean);
}
}

View File

@@ -1,23 +0,0 @@
package com.zhidao.adas.client.bean;
import com.google.protobuf.TextFormat;
import java.text.SimpleDateFormat;
import mogo.telematics.pad.MessagePad;
public class PlanningObjects extends BaseInfo {
public final MessagePad.PlanningObjects bean;
public PlanningObjects(MessagePad.Header header, MessagePad.PlanningObjects bean, SimpleDateFormat sdf) {
super("接收", bean.getSerializedSize(), header, sdf);
this.bean = bean;
}
@Override
public String toString() {
return super.toString() + TextFormat.printer().escapingNonAscii(false).printToString(bean);
}
}

View File

@@ -1,24 +0,0 @@
package com.zhidao.adas.client.bean;
import com.google.protobuf.TextFormat;
import java.text.SimpleDateFormat;
import mogo.telematics.pad.MessagePad;
import prediction.Prediction;
public class PredictionObstacleTrajectory extends BaseInfo {
public final Prediction.mPredictionObjects bean;
public PredictionObstacleTrajectory(MessagePad.Header header, Prediction.mPredictionObjects bean, SimpleDateFormat sdf) {
super("接收", bean.getSerializedSize(), header, sdf);
this.bean = bean;
}
@Override
public String toString() {
return super.toString() + TextFormat.printer().escapingNonAscii(false).printToString(bean);
}
}

View File

@@ -0,0 +1,25 @@
package com.zhidao.adas.client.bean;
import com.google.protobuf.GeneratedMessageV3;
import com.google.protobuf.TextFormat;
import com.zhidao.support.adas.high.common.ByteUtil;
import java.text.SimpleDateFormat;
import mogo.telematics.pad.MessagePad;
public class ReceiveData extends BaseInfo {
public final GeneratedMessageV3 bean;
public ReceiveData(MessagePad.Header header, GeneratedMessageV3 bean, SimpleDateFormat sdf) {
super("接收", bean.getSerializedSize(), header, sdf);
this.bean = bean;
}
@Override
public String toString() {
return super.toString() + "Payload原始数据" + ByteUtil.byteArrToHex(bean.toByteArray()) + '\n' + TextFormat.printer().escapingNonAscii(false).printToString(bean);
}
}

View File

@@ -1,22 +0,0 @@
package com.zhidao.adas.client.bean;
import com.google.protobuf.TextFormat;
import java.text.SimpleDateFormat;
import mogo.telematics.pad.MessagePad;
public class RecordDataConfig extends BaseInfo {
public final MessagePad.RecordDataConfig bean;
public RecordDataConfig(MessagePad.Header header, MessagePad.RecordDataConfig bean, SimpleDateFormat sdf) {
super("接收", bean.getSerializedSize(), header, sdf);
this.bean = bean;
}
@Override
public String toString() {
return super.toString() + TextFormat.printer().escapingNonAscii(false).printToString(bean);
}
}

View File

@@ -1,24 +0,0 @@
package com.zhidao.adas.client.bean;
import com.google.protobuf.TextFormat;
import java.text.SimpleDateFormat;
import mogo.telematics.pad.MessagePad;
import record_cache.RecordPanelOuterClass;
public class RecordPanel extends BaseInfo {
public final RecordPanelOuterClass.RecordPanel bean;
public RecordPanel(MessagePad.Header header, RecordPanelOuterClass.RecordPanel bean, SimpleDateFormat sdf) {
super("接收", bean.getSerializedSize(), header, sdf);
this.bean = bean;
}
@Override
public String toString() {
return super.toString() + TextFormat.printer().escapingNonAscii(false).printToString(bean);
}
}

View File

@@ -1,24 +0,0 @@
package com.zhidao.adas.client.bean;
import com.google.protobuf.TextFormat;
import java.text.SimpleDateFormat;
import mogo.telematics.pad.MessagePad;
import planning.RoboSweeperTaskIndexOuterClass;
public class RoboSweeperTaskIndex extends BaseInfo {
public final RoboSweeperTaskIndexOuterClass.RoboSweeperTaskIndex bean;
public RoboSweeperTaskIndex(MessagePad.Header header, RoboSweeperTaskIndexOuterClass.RoboSweeperTaskIndex bean, SimpleDateFormat sdf) {
super("接收", bean.getSerializedSize(), header, sdf);
this.bean = bean;
}
@Override
public String toString() {
return super.toString() + TextFormat.printer().escapingNonAscii(false).printToString(bean);
}
}

View File

@@ -1,24 +0,0 @@
package com.zhidao.adas.client.bean;
import com.google.protobuf.TextFormat;
import java.text.SimpleDateFormat;
import mogo.telematics.pad.MessagePad;
import system_master.SystemStatusInfo;
public class StatusInfo extends BaseInfo {
public final SystemStatusInfo.StatusInfo bean;
public StatusInfo(MessagePad.Header header, SystemStatusInfo.StatusInfo bean, SimpleDateFormat sdf) {
super("接收", bean.getSerializedSize(), header, sdf);
this.bean = bean;
}
@Override
public String toString() {
return super.toString() + TextFormat.printer().escapingNonAscii(false).printToString(bean);
}
}

View File

@@ -1,21 +0,0 @@
package com.zhidao.adas.client.bean;
import com.google.protobuf.TextFormat;
import java.text.SimpleDateFormat;
import mogo.telematics.pad.MessagePad;
public class TrackedObjects extends BaseInfo {
private MessagePad.TrackedObjects bean;
public TrackedObjects(MessagePad.Header header, MessagePad.TrackedObjects bean, SimpleDateFormat sdf) {
super("接收", bean.getSerializedSize(), header, sdf);
this.bean = bean;
}
@Override
public String toString() {
return super.toString() + TextFormat.printer().escapingNonAscii(false).printToString(bean);
}
}

View File

@@ -1,21 +0,0 @@
package com.zhidao.adas.client.bean;
import com.google.protobuf.TextFormat;
import java.text.SimpleDateFormat;
import mogo.telematics.pad.MessagePad;
public class Trajectory extends BaseInfo {
public final MessagePad.Trajectory bean;
public Trajectory(MessagePad.Header header, MessagePad.Trajectory bean, SimpleDateFormat sdf) {
super("接收", bean.getSerializedSize(), header, sdf);
this.bean = bean;
}
@Override
public String toString() {
return super.toString() + TextFormat.printer().escapingNonAscii(false).printToString(bean);
}
}

View File

@@ -1,22 +0,0 @@
package com.zhidao.adas.client.bean;
import com.google.protobuf.TextFormat;
import java.text.SimpleDateFormat;
import chassis.VehicleStateOuterClass;
import mogo.telematics.pad.MessagePad;
public class VehicleState extends BaseInfo {
public final VehicleStateOuterClass.VehicleState bean;
public VehicleState(MessagePad.Header header, VehicleStateOuterClass.VehicleState bean, SimpleDateFormat sdf) {
super("接收", bean.getSerializedSize(), header, sdf);
this.bean = bean;
}
@Override
public String toString() {
return super.toString() + TextFormat.printer().escapingNonAscii(false).printToString(bean);
}
}

View File

@@ -1,21 +0,0 @@
package com.zhidao.adas.client.bean;
import com.google.protobuf.TextFormat;
import java.text.SimpleDateFormat;
import mogo.telematics.pad.MessagePad;
public class Warn extends BaseInfo {
public final MessagePad.Warn bean;
public Warn(MessagePad.Header header, MessagePad.Warn bean, SimpleDateFormat sdf) {
super("接收", bean.getSerializedSize(), header, sdf);
this.bean = bean;
}
@Override
public String toString() {
return super.toString() + TextFormat.printer().escapingNonAscii(false).printToString(bean);
}
}

View File

@@ -1,7 +1,5 @@
package com.zhidao.adas.client.ui;
import static com.mogo.telematic.MogoProtocolMsg.NORMAL_DATA;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
@@ -45,11 +43,7 @@ import androidx.recyclerview.widget.SimpleItemAnimator;
import com.google.protobuf.TextFormat;
import com.mogo.support.obu.ObuScene;
import com.mogo.telematic.MogoProtocolMsg;
import com.mogo.telematic.NSDNettyManager;
import com.mogo.telematic.client.listener.NettyClientListener;
import com.mogo.telematic.client.status.ConnectState;
import com.mogo.telematic.server.netty.NettyServerListener;
import com.zhidao.adas.client.App;
import com.zhidao.adas.client.BuildConfig;
import com.zhidao.adas.client.DataDistribution;
import com.zhidao.adas.client.R;
@@ -57,36 +51,16 @@ import com.zhidao.adas.client.adapter.InfoTitleAdapter;
import com.zhidao.adas.client.base.BaseActivity;
import com.zhidao.adas.client.base.BaseAdapter;
import com.zhidao.adas.client.base.BaseFragment;
import com.zhidao.adas.client.bean.ArrivalNotification;
import com.zhidao.adas.client.bean.AutopilotState;
import com.zhidao.adas.client.bean.BagManagerCmd;
import com.zhidao.adas.client.bean.BasicInfoReq;
import com.zhidao.adas.client.bean.CarConfigResp;
import com.zhidao.adas.client.bean.ChassisStates;
import com.zhidao.adas.client.bean.ErrorData;
import com.zhidao.adas.client.bean.FSMFunctionStates;
import com.zhidao.adas.client.bean.GlobalPathResp;
import com.zhidao.adas.client.bean.GnssInfo;
import com.zhidao.adas.client.bean.IPCConnectState;
import com.zhidao.adas.client.bean.MogoReportMessage;
import com.zhidao.adas.client.bean.ObuMap;
import com.zhidao.adas.client.bean.ObuRsi;
import com.zhidao.adas.client.bean.ObuRsm;
import com.zhidao.adas.client.bean.ObuSpat;
import com.zhidao.adas.client.bean.OriginalPointCloudData;
import com.zhidao.adas.client.bean.PerceptionTrafficLight;
import com.zhidao.adas.client.bean.PlanningDecisionState;
import com.zhidao.adas.client.bean.PlanningObjects;
import com.zhidao.adas.client.bean.PredictionObstacleTrajectory;
import com.zhidao.adas.client.bean.RecordDataConfig;
import com.zhidao.adas.client.bean.RecordPanel;
import com.zhidao.adas.client.bean.RoboSweeperTaskIndex;
import com.zhidao.adas.client.bean.ReceiveData;
import com.zhidao.adas.client.bean.SpecialVehicleBean;
import com.zhidao.adas.client.bean.StatusInfo;
import com.zhidao.adas.client.bean.TrackedObjects;
import com.zhidao.adas.client.bean.Trajectory;
import com.zhidao.adas.client.bean.VehicleState;
import com.zhidao.adas.client.bean.Warn;
import com.zhidao.adas.client.log.ConnectStatusSave;
import com.zhidao.adas.client.log.LogSave;
import com.zhidao.adas.client.other.permission.BackgrounderPermission;
@@ -99,14 +73,12 @@ import com.zhidao.support.adas.high.AdasManager;
import com.zhidao.support.adas.high.AdasOptions;
import com.zhidao.support.adas.high.OnAdasConnectStatusListener;
import com.zhidao.support.adas.high.OnAdasListener;
import com.zhidao.support.adas.high.OnMultiDeviceListener;
import com.zhjt.mogo.adas.data.bean.AutopilotStatistics;
import com.zhidao.support.adas.high.bean.VersionCompatibility;
import com.zhidao.support.adas.high.common.ByteUtil;
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.ProtocolStatus;
import com.zhidao.support.adas.high.common.ReceiveTimeoutManager;
import com.zhjt.mogo.adas.data.bean.AutopilotStatistics;
import java.net.Inet4Address;
import java.net.InetAddress;
@@ -125,7 +97,6 @@ import bag_manager.BagManagerOuterClass;
import chassis.ChassisStatesOuterClass;
import chassis.VehicleStateOuterClass;
import function_state_management.FunctionStates;
import io.netty.channel.Channel;
import mogo.telematics.pad.MessagePad;
import mogo_msg.MogoReportMsg;
import perception.TrafficLightOuterClass;
@@ -880,44 +851,46 @@ public class MainActivity extends BaseActivity implements OnAdasListener, OnAdas
@Override
public void onTrajectory(MessagePad.Header header, MessagePad.Trajectory trajectory) {
Trajectory base = new Trajectory(header, trajectory, sdf);
ReceiveData base = new ReceiveData(header, trajectory, sdf);
DataDistribution.getInstance().addData(base);
}
@Override
public void onTrackedObjects(MessagePad.Header header, MessagePad.TrackedObjects trackedObjects) {
TrackedObjects base = new TrackedObjects(header, trackedObjects, sdf);
ReceiveData base = new ReceiveData(header, trackedObjects, sdf);
DataDistribution.getInstance().addData(base);
}
@Override
public void onGnssInfo(MessagePad.Header header, MessagePad.GnssInfo gnssInfo) {
GnssInfo base = new GnssInfo(header, gnssInfo, sdf);
ReceiveData base = new ReceiveData(header, gnssInfo, sdf);
DataDistribution.getInstance().addData(base);
}
@Override
public void onVehicleState(MessagePad.Header header, VehicleStateOuterClass.VehicleState vehicleState) {
VehicleState base = new VehicleState(header, vehicleState, sdf);
App.INSTANCE.gear = vehicleState.getGear();
ReceiveData base = new ReceiveData(header, vehicleState, sdf);
DataDistribution.getInstance().addData(base);
}
@Override
public void onChassisStates(MessagePad.Header header, ChassisStatesOuterClass.ChassisStates chassisStates) {
ChassisStates base = new ChassisStates(header, chassisStates, sdf);
App.INSTANCE.gear = chassisStates.getGearSystemStates().getGearPosition();
ReceiveData base = new ReceiveData(header, chassisStates, sdf);
DataDistribution.getInstance().addData(base);
}
@Override
public void onAutopilotState(MessagePad.Header header, MessagePad.AutopilotState autopilotState) {
AutopilotState base = new AutopilotState(header, autopilotState, sdf);
ReceiveData base = new ReceiveData(header, autopilotState, sdf);
DataDistribution.getInstance().addData(base);
}
@Override
public void onReportMessage(MessagePad.Header header, MogoReportMsg.MogoReportMessage mogoReportMessage) {
MogoReportMessage base = new MogoReportMessage(header, mogoReportMessage, sdf);
ReceiveData base = new ReceiveData(header, mogoReportMessage, sdf);
DataDistribution.getInstance().addData(base);
}
@@ -929,7 +902,7 @@ public class MainActivity extends BaseActivity implements OnAdasListener, OnAdas
@Override
public void onPredictionObstacleTrajectory(MessagePad.Header header, Prediction.mPredictionObjects predictionObjects) {
PredictionObstacleTrajectory base = new PredictionObstacleTrajectory(header, predictionObjects, sdf);
ReceiveData base = new ReceiveData(header, predictionObjects, sdf);
DataDistribution.getInstance().addData(base);
}
@@ -968,32 +941,32 @@ public class MainActivity extends BaseActivity implements OnAdasListener, OnAdas
@Override
public void onPlanningObjects(MessagePad.Header header, MessagePad.PlanningObjects planningObjects) {
PlanningObjects base = new PlanningObjects(header, planningObjects, sdf);
ReceiveData base = new ReceiveData(header, planningObjects, sdf);
DataDistribution.getInstance().addData(base);
}
@Override
public void onBasicInfoReq(MessagePad.Header header, MessagePad.BasicInfoReq basicInfoReq) {
BasicInfoReq info = new BasicInfoReq(header, basicInfoReq, sdf);
DataDistribution.getInstance().addData(info);
ReceiveData base = new ReceiveData(header, basicInfoReq, sdf);
DataDistribution.getInstance().addData(base);
AdasManager.getInstance().sendBasicInfoResp("", 0, com.zhidao.support.adas.high.common.Constants.TERMINAL_ROLE.DEBUG);
runOnUiThread(new Runnable() {
@Override
public void run() {
showToastCenter("收到车机基础信息请求:" + info.toString());
showToastCenter("收到车机基础信息请求:" + base.toString());
}
});
}
@Override
public void onCarConfigResp(MessagePad.Header header, MessagePad.CarConfigResp carConfigResp) {
CarConfigResp base = new CarConfigResp(header, carConfigResp, sdf);
ReceiveData base = new ReceiveData(header, carConfigResp, sdf);
DataDistribution.getInstance().addData(base);
}
@Override
public void onRecordResult(MessagePad.Header header, RecordPanelOuterClass.RecordPanel recordPanel) {
RecordPanel base = new RecordPanel(header, recordPanel, sdf);
ReceiveData base = new ReceiveData(header, recordPanel, sdf);
DataDistribution.getInstance().addData(base);
recordKey = recordPanel.getKey();
recordFileName = recordPanel.getFilename();
@@ -1001,37 +974,37 @@ public class MainActivity extends BaseActivity implements OnAdasListener, OnAdas
@Override
public void onGlobalPathResp(MessagePad.Header header, MessagePad.GlobalPathResp globalPathResp) {
GlobalPathResp base = new GlobalPathResp(header, globalPathResp, sdf);
ReceiveData base = new ReceiveData(header, globalPathResp, sdf);
DataDistribution.getInstance().addData(base);
}
@Override
public void onWarn(MessagePad.Header header, MessagePad.Warn warn) {
Warn base = new Warn(header, warn, sdf);
ReceiveData base = new ReceiveData(header, warn, sdf);
DataDistribution.getInstance().addData(base);
}
@Override
public void onArrivalNotification(MessagePad.Header header, MessagePad.ArrivalNotification arrivalNotification) {
ArrivalNotification base = new ArrivalNotification(header, arrivalNotification, sdf);
ReceiveData base = new ReceiveData(header, arrivalNotification, sdf);
DataDistribution.getInstance().addData(base);
}
@Override
public void onStatusQueryResp(MessagePad.Header header, SystemStatusInfo.StatusInfo statusInfo) {
StatusInfo base = new StatusInfo(header, statusInfo, sdf);
ReceiveData base = new ReceiveData(header, statusInfo, sdf);
DataDistribution.getInstance().addData(base);
}
@Override
public void onRecordDataConfigResp(MessagePad.Header header, MessagePad.RecordDataConfig config) {
RecordDataConfig base = new RecordDataConfig(header, config, sdf);
ReceiveData base = new ReceiveData(header, config, sdf);
DataDistribution.getInstance().addData(base);
}
@Override
public void onPlanningActionMsg(MessagePad.Header header, MessagePad.PlanningActionMsg planningActionMsg) {
PlanningDecisionState base = new PlanningDecisionState(header, planningActionMsg, sdf);
ReceiveData base = new ReceiveData(header, planningActionMsg, sdf);
DataDistribution.getInstance().addData(base);
}
@@ -1062,19 +1035,19 @@ public class MainActivity extends BaseActivity implements OnAdasListener, OnAdas
@Override
public void onFunctionStates(MessagePad.Header header, FunctionStates.FSMFunctionStates functionStates) {
FSMFunctionStates base = new FSMFunctionStates(header, functionStates, sdf);
ReceiveData base = new ReceiveData(header, functionStates, sdf);
DataDistribution.getInstance().addData(base);
}
@Override
public void onSweeperTaskIndexData(MessagePad.Header header, RoboSweeperTaskIndexOuterClass.RoboSweeperTaskIndex roboSweeperTaskIndex) {
RoboSweeperTaskIndex base = new RoboSweeperTaskIndex(header, roboSweeperTaskIndex, sdf);
ReceiveData base = new ReceiveData(header, roboSweeperTaskIndex, sdf);
DataDistribution.getInstance().addData(base);
}
@Override
public void onBagManagerCmd(MessagePad.Header header, BagManagerOuterClass.BagManager bagManager) {
BagManagerCmd base = new BagManagerCmd(header, bagManager, sdf);
ReceiveData base = new ReceiveData(header, bagManager, sdf);
DataDistribution.getInstance().addData(base);
}
@@ -1084,6 +1057,7 @@ public class MainActivity extends BaseActivity implements OnAdasListener, OnAdas
if (BuildConfig.IS_CLIENT) {
/*—————————————作为乘客端———————————*/
options = new AdasOptions.Builder().setClient(true).build();
/*乘客端启动 注释掉
NSDNettyManager.getInstance().searchAndConnectServer(this, "1234", new NettyClientListener<MogoProtocolMsg>() {
@Override
@@ -1103,7 +1077,7 @@ public class MainActivity extends BaseActivity implements OnAdasListener, OnAdas
getHandler().sendEmptyMessage(WHAT_DRIVER_IP);
onUpdateConnectStateView();
}
});
});*/
} else {
/*—————————————作为司机端———————————*/
int mode = Constants.getIpcConnectionMode(this);
@@ -1126,6 +1100,7 @@ public class MainActivity extends BaseActivity implements OnAdasListener, OnAdas
break;
}
/*司机端启动 注释掉
NSDNettyManager.getInstance().startNSDNettyServerWithSN(this, new NettyServerListener<MogoProtocolMsg>() {
@Override
public void onMessageResponseServer(MogoProtocolMsg msg, Channel channel) {
@@ -1152,10 +1127,11 @@ public class MainActivity extends BaseActivity implements OnAdasListener, OnAdas
public void onChannelDisConnect(Channel channel) {
Log.i(TAG, "onChannelDisConnect channel=" + channel.id());
}
}, "1234567");
}, "1234567");*/
}
AdasManager.getInstance().create(options, this);
AdasManager.getInstance().setOnAdasListener(this);
/*两端数据转发 注释掉
AdasManager.getInstance().setOnMultiDeviceListener(new OnMultiDeviceListener() {
@Override
public void onForwardingDriverIPCMessage(byte[] bytes) {
@@ -1173,7 +1149,7 @@ public class MainActivity extends BaseActivity implements OnAdasListener, OnAdas
.sendMogoProtocolMsgToServer(new MogoProtocolMsg(NORMAL_DATA, bytes.length, bytes), null);
Log.i(TAG, "乘客屏发送数据=" + ByteUtil.byteArrToHex(bytes));
}
});
});*/
}
@@ -1587,7 +1563,7 @@ public class MainActivity extends BaseActivity implements OnAdasListener, OnAdas
break;
case WHAT_DRIVER_IP:
ipcIp.setVisibility(View.VISIBLE);
ipcIp.setText("司机IP" + NSDNettyManager.getInstance().getConnServerIp());
// ipcIp.setText("司机IP" + NSDNettyManager.getInstance().getConnServerIp());
break;
case WHAT_IPC_CONNECT_STATE:
if (floatWindow != null) {

View File

@@ -23,6 +23,7 @@ import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import androidx.recyclerview.widget.SimpleItemAnimator;
import com.zhidao.adas.client.App;
import com.zhidao.adas.client.BuildConfig;
import com.zhidao.adas.client.R;
import com.zhidao.adas.client.adapter.ConfigAdapter;
@@ -36,6 +37,7 @@ import com.zhidao.support.adas.high.bean.VersionCompatibility;
import com.zhidao.support.adas.high.common.Constants;
import com.zhidao.support.adas.high.common.CupidLogUtils;
import com.zhidao.support.adas.high.common.MessageType;
import com.zhidao.support.adas.high.common.autopilot.ability.AutopilotAbilityManager;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
@@ -45,6 +47,7 @@ import java.util.List;
import java.util.Locale;
import java.util.Set;
import chassis.Chassis;
import mogo.telematics.pad.MessagePad;
/**
@@ -65,7 +68,7 @@ public class VersionFragment extends BaseFragment {
private ConfigAdapter adapter;
private InterfaceAdapter unregisteredAdapter;
private InterfaceAdapter registeredAdapter;
private Set[] unableGears;
private int role = Constants.TERMINAL_ROLE.DEBUG;//角色 默认调试屏
@@ -216,9 +219,48 @@ public class VersionFragment extends BaseFragment {
list.add(new Config("ADAS LIB版本:", AdasManager.getInstance().getAdasVersion()));
list.add(new Config("APP构建时间:", BuildConfig.BUILD_TIME));
list.add(getAutopilotAbilityConfig(""));
list.add(gear());
adapter.setData(list);
}
private Config gear() {
StringBuilder builder = new StringBuilder();
Chassis.GearPosition gear = App.INSTANCE.gear;
if (gear != null) {
if (unableGears == null) {
unableGears = new Set[6];
unableGears[0] = BuildConfig.UNABLE_LAUNCH_AUTOPILOT_GEAR_BUS;
unableGears[1] = BuildConfig.UNABLE_LAUNCH_AUTOPILOT_GEAR_M1;
unableGears[2] = BuildConfig.UNABLE_LAUNCH_AUTOPILOT_GEAR_M2;
unableGears[3] = BuildConfig.UNABLE_LAUNCH_AUTOPILOT_GEAR_SWEEPER;
unableGears[4] = BuildConfig.UNABLE_LAUNCH_AUTOPILOT_GEAR_TAXI;
unableGears[5] = BuildConfig.UNABLE_LAUNCH_AUTOPILOT_GEAR_VAN;
}
for (int j = 0; j < unableGears.length; j++) {
String type = "";
if (j == 0) {
type = "BUS";
} else if (j == 1) {
type = "M1";
} else if (j == 2) {
type = "M2";
} else if (j == 3) {
type = "SWEEPER";
} else if (j == 4) {
type = "TAXI";
} else if (j == 5) {
type = "VAN";
}
AutopilotAbilityManager.getInstance().setUnableLaunchAutopilotGear(unableGears[j]);
boolean b = AutopilotAbilityManager.getInstance().isLaunchAutopilot(gear);
builder.append("车型:").append(type);
builder.append(" 当前档位:").append(gear.name());
builder.append(" 是否可以启动自驾:").append(b).append('\n');
}
}
return new Config("档位影响:", builder.toString());
}
private Config getAutopilotAbilityConfig(String value) {
return new Config("能否启动自动驾驶:", value);
}
@@ -226,32 +268,34 @@ public class VersionFragment extends BaseFragment {
public void autopilotAbility(boolean isAutopilotAbility, String unableAutopilotReason) {
List<Config> list = adapter.getData();
if (list != null) {
Config temp = getAutopilotAbilityConfig(isAutopilotAbility + ",原因:" + unableAutopilotReason);
int index = list.indexOf(temp);
if (index < 0) {
list.add(temp);
if (getActivity() != null)
getActivity().runOnUiThread(new Runnable() {
@Override
public void run() {
adapter.notifyItemInserted(list.size() - 1);
}
});
} else {
Config config = list.get(index);
config.cover(temp);
config.color = RandomColor.randomColor();
if (getActivity() != null)
getActivity().runOnUiThread(new Runnable() {
@Override
public void run() {
adapter.notifyItemChanged(index);
}
});
}
updateRefreshConfig(list, getAutopilotAbilityConfig(isAutopilotAbility + ",原因:" + unableAutopilotReason));
updateRefreshConfig(list, gear());
}
}
private void updateRefreshConfig(List<Config> list, Config temp) {
int index = list.indexOf(temp);
if (index < 0) {
list.add(temp);
if (getActivity() != null)
getActivity().runOnUiThread(new Runnable() {
@Override
public void run() {
adapter.notifyItemInserted(list.size() - 1);
}
});
} else {
Config config = list.get(index);
config.cover(temp);
config.color = RandomColor.randomColor();
if (getActivity() != null)
getActivity().runOnUiThread(new Runnable() {
@Override
public void run() {
adapter.notifyItemChanged(index);
}
});
}
}
@Override

View File

@@ -19,7 +19,7 @@
<color name="connect_status_search_address">#1E90FF</color>
<color name="color1">#FFC0CB</color>
<color name="color2">#FF8F00</color>
<color name="color3">#FFE500</color>
<color name="color4">#B9ED3E</color>
<color name="color3">#FF33FF</color>
<color name="color4">#669900</color>
<color name="color5">#2EEDEB</color>
</resources>

View File

@@ -5,9 +5,12 @@ import com.mogo.eagle.core.data.enums.DataSourceType
import com.mogo.eagle.core.data.msgbox.MsgBoxBean
import com.mogo.eagle.core.data.msgbox.MsgBoxType
import com.mogo.eagle.core.data.msgbox.V2XMsg
import com.mogo.eagle.core.data.obu.MogoObuConst
import com.mogo.eagle.core.function.api.obu.IMoGoObuSaveMessageListener
import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxManager
import com.mogo.eagle.core.function.call.obu.CallerObuSaveMessageListenerManager
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant
/**
* 处理obu分发出来在消息盒子展示的消息
@@ -48,6 +51,7 @@ object V2xObuEventManager : IMoGoObuSaveMessageListener {
obuDataMap[type] = System.currentTimeMillis()
}
CallerLogger.d("${SceneConstant.M_OBU}${TAG}", "onMoGoObuSaveMessage type = $type ---content = $content ---tts = $tts ")
CallerMsgBoxManager.saveMsgBox(
MsgBoxBean(
MsgBoxType.V2X,

View File

@@ -107,7 +107,7 @@ class MoGoAutopilotControlProvider :
.setIpcConnectionMode(AdasOptions.IPC_CONNECTION_MODE.FIXATION)
.setIpcFixationIP(AdasManager.getInstance().getIPCFixationIPList(mContext))
.setClient(false)
.setIdentityMode(FunctionBuildConfig.appIdentityMode)
.setUnableLaunchAutopilotGear(FunctionBuildConfig.unableLaunchAutopilotGear)
// .setSubscribeInterfaceOptions(subscribeInterfaceOptions)//
.build()
@@ -198,7 +198,7 @@ class MoGoAutopilotControlProvider :
val options = AdasOptions
.Builder()
.setClient(true)
.setIdentityMode(FunctionBuildConfig.appIdentityMode)
.setUnableLaunchAutopilotGear(FunctionBuildConfig.unableLaunchAutopilotGear)
.build()
AdasManager.getInstance()
.create(options, MoGoAdasMsgConnectStatusListenerImpl())
@@ -226,7 +226,7 @@ class MoGoAutopilotControlProvider :
.setIpcConnectionMode(AdasOptions.IPC_CONNECTION_MODE.FIXATION)
.setIpcFixationIP(AdasManager.getInstance().getIPCFixationIPList(mContext))
.setClient(false)// 乘客端直连工控机改为false
.setIdentityMode(FunctionBuildConfig.appIdentityMode)
.setUnableLaunchAutopilotGear(FunctionBuildConfig.unableLaunchAutopilotGear)
.build()
AdasManager.getInstance().create(options, MoGoAdasMsgConnectStatusListenerImpl())
//////////////////////////////////注意先后顺序AdasManager.getInstance().create后才可以设置监听/////////////////////////////////////////////

View File

@@ -242,6 +242,9 @@ class MogoObuDcCombineManager private constructor() : IMoGoObuWarningRsiListener
when (status) {
// 添加
MogoObuConstants.STATUS.ADD -> {
if (alertContent.isEmpty() || ttsContent.isEmpty()) {
return
}
saveObuToDcData(appId, alertContent, ttsContent)
showWarning(appId, alertContent, ttsContent, direction)
}
@@ -502,6 +505,9 @@ class MogoObuDcCombineManager private constructor() : IMoGoObuWarningRsiListener
"${M_OBU}${TAG}",
"MogoObuDcCombineManager changeTrafficLightStatus 闯红灯 --------> ttsContent = $ttsContent ---alertContent = $alertContent "
)
if (alertContent.isEmpty() || ttsContent.isEmpty()) {
return
}
saveObuToDcData(EventTypeEnumNew.TYPE_USECASE_ID_IVP_RED.poiType, alertContent, ttsContent)
showWarning(EventTypeEnumNew.TYPE_USECASE_ID_IVP_RED.poiType, alertContent, ttsContent, WarningDirectionEnum.ALERT_WARNING_NON)
}
@@ -539,6 +545,9 @@ class MogoObuDcCombineManager private constructor() : IMoGoObuWarningRsiListener
)
val maxSpeed = currentLight.suggestMaxSpeed * 3.6
if (maxSpeed > 0) {
if (alertContent.isEmpty() || ttsContent.isEmpty()) {
return
}
saveObuToDcData(EventTypeEnumNew.TYPE_USECASE_ID_IVP_GREEN.poiType, alertContent, ttsContent)
showWarning(EventTypeEnumNew.TYPE_USECASE_ID_IVP_GREEN.poiType, alertContent, ttsContent, WarningDirectionEnum.ALERT_WARNING_NON)
}

View File

@@ -1037,8 +1037,6 @@ class MogoPrivateObuNewManager private constructor() : OnUpgradeListener {
)
}
private val ttsMap = mutableMapOf<String, Long>()
/**
* 消息盒子对应消息的语音播报
*/
@@ -1048,19 +1046,6 @@ class MogoPrivateObuNewManager private constructor() : OnUpgradeListener {
tts: String,
direction: WarningDirectionEnum
) {
//30秒内同一个事件只出现一次 TODO 临时添加,后面宏宇统一在数据中心处理
if (ttsMap.containsKey(type)) {
var oldTime = ttsMap[type]
var timeDiff = (System.currentTimeMillis() - oldTime!!) / 1000
if (timeDiff < 30) {
return
}
ttsMap.remove(type)
ttsMap[type] = System.currentTimeMillis()
} else {
ttsMap[type] = System.currentTimeMillis()
}
CallerHmiManager.warningV2X(
type,
content,

View File

@@ -158,6 +158,10 @@ class DevaToolsProvider : IDevaToolsProvider {
BadCaseManager.showBadCaseConfigWindow(ctx)
}
override fun showBadCaseManagerView(context: Context) {
BadCaseManager.showBadCaseManagerWindow(context)
}
override fun downLoadPackage(downloadKey: String, downloadUrl: String) {
upgradeManager.downLoadPackage(mContext!!, downloadKey, downloadUrl)
}

View File

@@ -101,6 +101,22 @@ internal object BadCaseManager : LifecycleEventObserver, IMoGoAutopilotRecordLis
}
}
/**
* 展示BadCase录包管理页面
*/
fun showBadCaseManagerWindow(context: Context){
val badCaseManagerView = BadCaseManagerView(context)
badCaseManagerView.setOnClickListener(object: BadCaseManagerView.ClickListener{
override fun onClose() {
hideFloat?.invoke()
hideFloat = null
}
})
context.enqueuePop(badCaseManagerView,AutoSizeUtils.dp2px(context,960f), WindowManager.LayoutParams.MATCH_PARENT, key = "BadCaseManagerView").also {
hideFloat = it
}
}
/**
* 主动采集BadCase
*/

View File

@@ -56,8 +56,6 @@ class BindingCarNetWorkManager private constructor() {
widevineIDWithMd5: String?,
screenType: Int
) {
// String macAddress1 = "48:b0:2d:4d:33:40";
// String sn = "X2020220417KA94QIN";
val request = BindingCarRequest(
macAddress,
widevineIDWithMd5,
@@ -152,12 +150,14 @@ class BindingCarNetWorkManager private constructor() {
}
private fun updateCarVrIconRes(brandId: String?) {
d(SceneConstant.M_BINDING + TAG, "CarModelChange : ${DebugConfig.isCarModelChange()}")
if(!DebugConfig.isCarModelChange()){
return
}
if (brandId == null || brandId.isEmpty()) {
return
}
d(SceneConstant.M_BINDING + TAG, "getDefaultId() : ${getDefaultId()} ---- brandId = $brandId")
if (getDefaultId() == brandId) {
return
}

View File

@@ -39,6 +39,7 @@ import com.mogo.eagle.core.function.hmi.ui.widget.StatusBarView
import com.mogo.eagle.core.utilcode.kotlin.safeCancel
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_HMI
import com.mogo.eagle.core.utilcode.util.ThreadUtils
import com.zhjt.service_biz.BizConfig
@@ -87,6 +88,8 @@ class MoGoHmiProvider : IMoGoHmiProvider {
)
}
private val ttsMap = mutableMapOf<String, Long>()
/**
* 不展示顶部弹窗,其它保留
*/
@@ -99,6 +102,19 @@ class MoGoHmiProvider : IMoGoHmiProvider {
direction: WarningDirectionEnum,
expireTime: Long
) {
//30秒内同一个事件只出现一次 TODO 临时添加,后面宏宇统一在数据中心处理
if (ttsMap.containsKey(v2xType)) {
var oldTime = ttsMap[v2xType]
var timeDiff = (System.currentTimeMillis() - oldTime!!) / 1000
if (timeDiff < 30) {
return
}
ttsMap.remove(v2xType)
ttsMap[v2xType] = System.currentTimeMillis()
} else {
ttsMap[v2xType] = System.currentTimeMillis()
}
CallerLogger.d("${SceneConstant.M_OBU}${TAG}", "warningV2X v2xType = $v2xType ---alertContent = $alertContent ---ttsContent = $ttsContent ")
val playTTS = !AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode)
context?.let {
val warningContent = alertContent ?: EventTypeEnumNew.getWarningContent(v2xType)

View File

@@ -33,6 +33,8 @@ class DriverMsgBoxBubbleAdapter(private val activity: Activity) : RecyclerView.A
private var data: ArrayList<MsgBoxBean> ?= null
private val operation: Int = 1
private val operationReturn: Int = 10
private val operationStop: Int = 11
private val notice: Int = 2
private val v2x: Int = 3
private val report: Int = 4
@@ -55,6 +57,16 @@ class DriverMsgBoxBubbleAdapter(private val activity: Activity) : RecyclerView.A
val view = LayoutInflater.from(parent.context).inflate(R.layout.item_msg_bubble_operation,parent,false)
return BubbleOperationHolder(view)
}
operationReturn -> {
val view = LayoutInflater.from(parent.context)
.inflate(R.layout.item_msg_bubble_operation_return, parent, false)
return BubbleOperationReturnHolder(view)
}
operationStop -> {
val view = LayoutInflater.from(parent.context)
.inflate(R.layout.item_msg_bubble_operation_stop, parent, false)
return BubbleOperationStopHolder(view)
}
report -> {
val view = LayoutInflater.from(parent.context).inflate(R.layout.item_msg_bubble_report,parent,false)
return BubbleReportHolder(view)
@@ -87,6 +99,23 @@ class DriverMsgBoxBubbleAdapter(private val activity: Activity) : RecyclerView.A
}
}
}
//运营平台还车通知
is BubbleOperationReturnHolder -> {
data?.let {
val operationReturnMsg = it[position].bean as OperationMsg
holder.tvOperationReturnContent.text = operationReturnMsg.content
holder.tvOperationReturnTime.text =
TimeUtils.millis2String(operationReturnMsg.timestamp, getHourMinFormat())
}
}
//运营平台靠边停车
is BubbleOperationStopHolder -> {
data?.let {
val operationStopMsg = it[position].bean as OperationMsg
holder.tvOperationStopTime.text =
TimeUtils.millis2String(operationStopMsg.timestamp, getHourMinFormat())
}
}
is BubbleReportHolder -> {
data?.let {
val msgBoxBean = it[position]
@@ -187,7 +216,16 @@ class DriverMsgBoxBubbleAdapter(private val activity: Activity) : RecyclerView.A
override fun getItemViewType(position: Int): Int {
return if(data!![position].type == MsgBoxType.OPERATION){
operation
if((data!![position].bean as OperationMsg).type == 0){
//运营平台还车通知
operationReturn
}else if((data!![position].bean as OperationMsg).type == 1){
//运营平台靠边停车
operationStop
}else{
//普通运营平台
operation
}
}else if(data!![position].type == MsgBoxType.REPORT){
report
}else if(data!![position].type == MsgBoxType.NOTICE){
@@ -214,6 +252,17 @@ class DriverMsgBoxBubbleAdapter(private val activity: Activity) : RecyclerView.A
var clBubbleOperationLayout: RoundCanClickConstraintLayout = itemView.findViewById(R.id.clBubbleOperationLayout)
}
//运营平台还车通知
class BubbleOperationReturnHolder(itemView: View): RecyclerView.ViewHolder(itemView){
var tvOperationReturnTime: TextView = itemView.findViewById(R.id.tvOperationReturnTime)
var tvOperationReturnContent: TextView = itemView.findViewById(R.id.tvOperationReturnContent)
}
//运营平台靠边停车通知
class BubbleOperationStopHolder(itemView: View): RecyclerView.ViewHolder(itemView){
var tvOperationStopTime: TextView = itemView.findViewById(R.id.tvOperationStopTime)
}
//Notice
class BubbleNoticeHolder(itemView: View): RecyclerView.ViewHolder(itemView){
var ivNoticeImage: ImageView = itemView.findViewById(R.id.ivNoticeImage)

View File

@@ -35,6 +35,8 @@ class DriverMsgBoxListAdapter(private val activity: Activity) :
private var reportBean: MsgBoxBean ?= null
private val operation: Int = 1
private val operationReturn: Int = 10
private val operationStop: Int = 11
private val notice: Int = 2
private val v2x: Int = 3
private val report: Int = 5
@@ -72,6 +74,16 @@ class DriverMsgBoxListAdapter(private val activity: Activity) :
.inflate(R.layout.item_msg_box_operation, parent, false)
return MsgBoxOperation(view)
}
operationReturn -> {
val view = LayoutInflater.from(parent.context)
.inflate(R.layout.item_msg_box_operation_return, parent, false)
return MsgBoxOperationReturn(view)
}
operationStop -> {
val view = LayoutInflater.from(parent.context)
.inflate(R.layout.item_msg_box_operation_stop, parent, false)
return MsgBoxOperationStop(view)
}
notice -> {
val view = LayoutInflater.from(parent.context)
.inflate(R.layout.item_msg_box_notice, parent, false)
@@ -244,6 +256,23 @@ class DriverMsgBoxListAdapter(private val activity: Activity) :
}
}
}
//运营平台还车通知
is MsgBoxOperationReturn -> {
data?.let {
val operationReturnMsg = it[position].bean as OperationMsg
holder.tvOperationReturnContent.text = operationReturnMsg.content
holder.tvOperationReturnTime.text =
TimeUtils.millis2String(operationReturnMsg.timestamp, getHourMinFormat())
}
}
//运营平台靠边停车
is MsgBoxOperationStop -> {
data?.let {
val operationStopMsg = it[position].bean as OperationMsg
holder.tvOperationStopTime.text =
TimeUtils.millis2String(operationStopMsg.timestamp, getHourMinFormat())
}
}
is MsgBoxNotice -> {
data?.let {
val noticeFrCloudMsg = it[position].bean as NoticeFrCloudMsg
@@ -314,7 +343,16 @@ class DriverMsgBoxListAdapter(private val activity: Activity) :
override fun getItemViewType(position: Int): Int {
return if (data!![position].type == MsgBoxType.OPERATION) {
operation
if((data!![position].bean as OperationMsg).type == 0){
//运营平台还车通知
operationReturn
}else if((data!![position].bean as OperationMsg).type == 1){
//运营平台靠边停车
operationStop
}else{
//普通运营平台
operation
}
} else if (data!![position].type == MsgBoxType.NOTICE) {
notice
} else if (data!![position].type == MsgBoxType.V2X && data!![position].sourceType == DataSourceType.SUMMARY) {
@@ -365,6 +403,17 @@ class DriverMsgBoxListAdapter(private val activity: Activity) :
var tvOperationContentOpen: TextView = itemView.findViewById(R.id.tvOperationContentOpen)
}
//运营平台还车通知
class MsgBoxOperationReturn(itemView: View) : RecyclerView.ViewHolder(itemView){
var tvOperationReturnTime: TextView = itemView.findViewById(R.id.tvOperationReturnTime)
var tvOperationReturnContent: TextView = itemView.findViewById(R.id.tvOperationReturnContent)
}
//运营平台靠边停车通知
class MsgBoxOperationStop(itemView: View) : RecyclerView.ViewHolder(itemView){
var tvOperationStopTime: TextView = itemView.findViewById(R.id.tvOperationStopTime)
}
//Notice
class MsgBoxNotice(itemView: View) : RecyclerView.ViewHolder(itemView) {
var ivNoticeImage: ImageView = itemView.findViewById(R.id.ivNoticeImage)

View File

@@ -55,7 +55,8 @@ class ToolsView private constructor() {
}
override fun showBadCaseManagerView() {
ToastUtils.showShort("代码合并中")
dismissToolsFloatView()
CallerDevaToolsManager.showBadCaseManagerView(it)
}
})
}

View File

@@ -42,10 +42,10 @@ class LimitingVelocityView constructor(
if (limitingVelocity > 0) {
visibility = View.VISIBLE
tvLimitingVelocity.text = "$limitingVelocity"
tvLimitingSource.text = DataSourceType.getName(sourceType)
tvLimitingSource?.text = DataSourceType.getName(sourceType)
} else {
visibility = View.GONE
tvLimitingSource.text = ""
tvLimitingSource?.text = ""
}
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

View File

@@ -0,0 +1,64 @@
<?xml version="1.0" encoding="utf-8"?>
<com.mogo.eagle.core.widget.RoundConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="804dp"
android:layout_height="160dp"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:background="#53000000"
app:roundLayoutRadius="24dp"
android:layout_gravity="center_horizontal"
android:layout_marginStart="30dp"
android:layout_marginEnd="30dp"
android:layout_marginTop="7dp"
android:layout_marginBottom="7dp">
<ImageView
android:id="@+id/ivOperationReturnImage"
android:layout_width="110dp"
android:layout_height="110dp"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
android:layout_marginTop="25dp"
android:layout_marginBottom="25dp"
android:layout_marginStart="25dp"
android:src="@drawable/icon_msg_box_operation_return"
/>
<TextView
android:id="@+id/tvOperationReturnTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="还车通知"
android:textColor="#FFFFFFFF"
android:textSize="32dp"
app:layout_constraintTop_toTopOf="@id/ivOperationReturnImage"
app:layout_constraintLeft_toRightOf="@id/ivOperationReturnImage"
android:layout_marginStart="23dp"
/>
<TextView
android:id="@+id/tvOperationReturnTime"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="@id/ivOperationReturnImage"
android:textColor="#80FFFFFF"
android:textSize="24dp"
android:layout_marginEnd="25dp"
/>
<TextView
android:id="@+id/tvOperationReturnContent"
android:layout_width="0dp"
android:layout_height="wrap_content"
app:layout_constraintLeft_toLeftOf="@id/tvOperationReturnTitle"
app:layout_constraintRight_toRightOf="@id/tvOperationReturnTime"
app:layout_constraintBottom_toBottomOf="@id/ivOperationReturnImage"
android:textColor="#B3FFFFFF"
android:textSize="28dp"
android:gravity="start"
android:maxLines="1"
android:ellipsize="end"
/>
</com.mogo.eagle.core.widget.RoundConstraintLayout>

View File

@@ -0,0 +1,54 @@
<?xml version="1.0" encoding="utf-8"?>
<com.mogo.eagle.core.widget.RoundConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="804dp"
android:layout_height="160dp"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:background="#53000000"
app:roundLayoutRadius="24dp"
android:layout_gravity="center_horizontal"
android:layout_marginStart="30dp"
android:layout_marginEnd="30dp"
android:layout_marginTop="7dp"
android:layout_marginBottom="7dp">
<ImageView
android:id="@+id/ivOperationStopImage"
android:layout_width="110dp"
android:layout_height="110dp"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
android:layout_marginTop="25dp"
android:layout_marginBottom="25dp"
android:layout_marginStart="25dp"
android:src="@drawable/icon_msg_box_operation_stop"
/>
<TextView
android:id="@+id/tvOperationStopTime"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintTop_toTopOf="@id/ivOperationStopImage"
app:layout_constraintRight_toRightOf="parent"
android:layout_marginEnd="25dp"
android:textColor="#80FFFFFF"
android:textSize="24dp"
/>
<TextView
android:id="@+id/tvOperationStopContent"
android:layout_width="0dp"
android:layout_height="wrap_content"
app:layout_constraintLeft_toRightOf="@id/ivOperationStopImage"
app:layout_constraintRight_toRightOf="@id/tvOperationStopTime"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
android:layout_marginStart="25dp"
android:textColor="#FFFFFFFF"
android:textSize="32dp"
android:maxLines="1"
android:ellipsize="end"
android:text="靠边停车"
/>
</com.mogo.eagle.core.widget.RoundConstraintLayout>

View File

@@ -0,0 +1,64 @@
<?xml version="1.0" encoding="utf-8"?>
<com.mogo.eagle.core.widget.RoundConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/clV2XLayout"
android:layout_width="804dp"
android:layout_height="160dp"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:background="#53000000"
app:roundLayoutRadius="24dp"
android:layout_gravity="center_horizontal"
android:layout_marginTop="7dp"
android:layout_marginBottom="7dp">
<ImageView
android:id="@+id/ivOperationReturnImage"
android:layout_width="110dp"
android:layout_height="110dp"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
android:layout_marginTop="25dp"
android:layout_marginBottom="25dp"
android:layout_marginStart="25dp"
android:src="@drawable/icon_msg_box_operation_return"
/>
<TextView
android:id="@+id/tvOperationReturnTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="还车通知"
android:textColor="#FFFFFFFF"
android:textSize="32dp"
app:layout_constraintTop_toTopOf="@id/ivOperationReturnImage"
app:layout_constraintLeft_toRightOf="@id/ivOperationReturnImage"
android:layout_marginStart="23dp"
/>
<TextView
android:id="@+id/tvOperationReturnTime"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="@id/ivOperationReturnImage"
android:textColor="#80FFFFFF"
android:textSize="24dp"
android:layout_marginEnd="25dp"
/>
<TextView
android:id="@+id/tvOperationReturnContent"
android:layout_width="0dp"
android:layout_height="wrap_content"
app:layout_constraintLeft_toLeftOf="@id/tvOperationReturnTitle"
app:layout_constraintRight_toRightOf="@id/tvOperationReturnTime"
app:layout_constraintBottom_toBottomOf="@id/ivOperationReturnImage"
android:textColor="#B3FFFFFF"
android:textSize="28dp"
android:gravity="start"
android:maxLines="1"
android:ellipsize="end"
/>
</com.mogo.eagle.core.widget.RoundConstraintLayout>

View File

@@ -0,0 +1,52 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="804dp"
android:layout_height="160dp"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:background="#53000000"
app:roundLayoutRadius="24dp"
android:layout_gravity="center_horizontal"
android:layout_marginTop="7dp"
android:layout_marginBottom="7dp">
<ImageView
android:id="@+id/ivOperationStopImage"
android:layout_width="110dp"
android:layout_height="110dp"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
android:layout_marginTop="25dp"
android:layout_marginBottom="25dp"
android:layout_marginStart="25dp"
android:src="@drawable/icon_msg_box_operation_stop"
/>
<TextView
android:id="@+id/tvOperationStopTime"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintTop_toTopOf="@id/ivOperationStopImage"
app:layout_constraintRight_toRightOf="parent"
android:layout_marginEnd="25dp"
android:textColor="#80FFFFFF"
android:textSize="24dp"
/>
<TextView
android:id="@+id/tvOperationStopContent"
android:layout_width="0dp"
android:layout_height="wrap_content"
app:layout_constraintLeft_toRightOf="@id/ivOperationStopImage"
app:layout_constraintRight_toRightOf="@id/tvOperationStopTime"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
android:layout_marginStart="25dp"
android:textColor="#FFFFFFFF"
android:textSize="32dp"
android:maxLines="1"
android:ellipsize="end"
android:text="靠边停车"
/>
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -24,18 +24,10 @@ public class CircleQueue {
objQueue.add(obj);
}
public void deleteObj(ObjQueue obj) {
objQueue.remove(obj);
}
public List<ObjQueue> getLastThreeFrame() {
return objQueue.subList(objQueue.size() - 3, objQueue.size());
}
public List<ObjQueue> getLastFiveFrame() {
return objQueue.subList(objQueue.size() - 5, objQueue.size());
}
public List<ObjQueue> getPreFrame() {
return objQueue.subList(0, objQueue.size());
}
@@ -44,6 +36,10 @@ public class CircleQueue {
return objQueue.lastElement();
}
public void clear(){
objQueue.clear();
}
@Override
public String toString() {
return "CircleQueue{" +

View File

@@ -2,6 +2,7 @@ package com.mogo.eagle.core.function.business.identify;
import android.annotation.SuppressLint;
import android.os.Build;
import android.util.Log;
import androidx.annotation.RequiresApi;
@@ -50,7 +51,7 @@ public class TrackManager {
* 记录每次实际绘制的交通元素UUID
*/
@SuppressLint("NewApi")
private final HashMap<String, Long> trafficDataUuid = new HashMap<>();
private final ConcurrentHashMap<String, Long> trafficDataUuid = new ConcurrentHashMap<>();
/**
* 过滤后的数据集合
@@ -101,7 +102,7 @@ public class TrackManager {
trackObj = cacheTrack;
MessagePad.TrackedObject cache = cacheTrack.getCache();
if (cache != null) {
//相对静止物体并且非obu数据则不改变感知融合同位置物体,使用缓存数据做覆盖
//相对静止物体 感知融合同位置物体,使用缓存数据做覆盖
if (cacheTrack.relativeStatic()) {
if (data.getColor() != null && !data.getColor().isEmpty()) {
cache = cache.toBuilder().setColor(data.getColor()).build();
@@ -112,10 +113,10 @@ public class TrackManager {
uuid = findSameValue;
trackObj.updateObj(data);
} else {
trackObj = new TrackObj(data);
trackObj = new TrackObj(data,s2CellId,s2LatLng);
}
} else {
trackObj = new TrackObj(data);
trackObj = new TrackObj(data,s2CellId,s2LatLng);
}
}
mFilterTrafficData.put(uuid, trackObj.getCache());
@@ -150,17 +151,23 @@ public class TrackManager {
}
public synchronized void removeKey(String key) {
mMarkersCaches.remove(key);
cellIdCaches.remove(key);
mMarkersCaches.remove(key);
WarningHelper.INSTANCE.remove(key);
MogoMarkerManager.getInstance(AbsMogoApplication.getApp())
.removeMarker(key);
}
@SuppressLint("NewApi")
public void clearAll() {
MogoMarkerManager.getInstance(AbsMogoApplication.getApp()).clearAllMarker();
cellIdCaches.clear();
trafficDataUuid.clear();
WarningHelper.INSTANCE.clear();
mMarkersCaches.forEach((uuid, trackObj) -> removeKey(uuid));
mMarkersCaches.forEach((uuid, trackObj) -> {
trackObj.clear();
});
mMarkersCaches.clear();
}
}

View File

@@ -5,8 +5,6 @@ import static com.mogo.eagle.core.function.business.identify.TrackManager.LIMIT_
import android.annotation.SuppressLint;
import com.mogo.eagle.core.data.enums.TrafficTypeEnum;
import com.mogo.eagle.core.data.map.CenterLine;
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager;
import com.mogo.eagle.core.utilcode.geometry.S2CellId;
import com.mogo.eagle.core.utilcode.geometry.S2LatLng;
import com.mogo.eagle.core.utilcode.util.CoordinateUtils;
@@ -22,26 +20,18 @@ public class TrackObj {
private final CircleQueue circleQueue = new CircleQueue(6);
private S2CellId s2CellId; //s2 id权重
private S2LatLng s2LatLng; //s2 经纬度
private double recentlyTime; //用于缓存帧数判断暂定缓存1秒数据中间如果有物体未出现1秒后删除
private double roadAngle; //道路航向
private int[] typeArray = new int[3];
private int typeWeight; //类型权重
private double lat;
private double lon;
private double speedAverage;
public TrackObj(MessagePad.TrackedObject data) {
public TrackObj(MessagePad.TrackedObject data, S2CellId cellId, S2LatLng latLng) {
circleQueue.addQueue(new ObjQueue(data.getHeading(), data.getSpeed(), data.getLatitude(), data.getLongitude(), data.getType()));
recentlyTime = data.getSatelliteTime();
lat = data.getLatitude();
lon = data.getLongitude();
s2LatLng = S2LatLng.fromDegrees(data.getLatitude(), data.getLongitude());
s2CellId = S2CellId.fromLatLng(s2LatLng).parent(22); //需要验证22前后
CenterLine centerLine = CallerMapUIServiceManager.INSTANCE.getMapUIController().getCenterLineInfo(lon, lat, -1);
if (centerLine != null && centerLine.getAngle() != 0) {
roadAngle = centerLine.getAngle();
}
s2LatLng = latLng;
s2CellId = cellId; //需要验证22前后
}
private MessagePad.TrackedObject cacheData;
@@ -50,14 +40,12 @@ public class TrackObj {
public void updateObj(MessagePad.TrackedObject data) {
cacheData = data;
correct();
recentlyTime = data.getSatelliteTime();
circleQueue.addQueue(new ObjQueue(cacheData.getHeading(), cacheData.getSpeed(), data.getLatitude(), data.getLongitude(), data.getType()));
}
private void correct() {
calAverageSpeedAndType();
calLoc();
// calHeading();
}
@SuppressLint("NewApi")
@@ -80,8 +68,10 @@ public class TrackObj {
}
speedAverage = cal / objQueueList.size();
}
typeArray = Arrays.stream(typeArray).sorted().toArray();
typeWeight = typeArray[typeArray.length / 2] == 0 ? cacheData.getType() : typeArray[typeArray.length / 2];
if(typeArray.length > 0){
typeArray = Arrays.stream(typeArray).sorted().toArray();
typeWeight = typeArray[typeArray.length / 2] == 0 ? cacheData.getType() : typeArray[typeArray.length / 2];
}
// 重新给静止物体赋值速度
if (relativeStatic()) {
@@ -105,26 +95,6 @@ public class TrackObj {
}
}
private void calHeading() {
//更正数据,速度小于LIMIT_SPEED使用上一帧数据
// if (relativeStatic()) {
// if (roadAngle != 0.0) {
// CenterLine centerLine = CallerHDMapManager.INSTANCE.getCenterLineInfo(lon, lat, -1);
// if (centerLine != null && centerLine.getAngle() != 0) {
// cacheData = cacheData.toBuilder().setHeading(centerLine.getAngle()).build();
// } else {
// cacheData = cacheData.toBuilder().setHeading(circleQueue.getLastFrame().getHeading()).build();
// }
// } else {
// cacheData = cacheData.toBuilder().setHeading(circleQueue.getLastFrame().getHeading()).build();
// }
// }
}
public double getRecentlyTime() {
return recentlyTime;
}
public long getCellIdPos() {
return s2CellId.pos();
}
@@ -167,12 +137,6 @@ public class TrackObj {
}
}
public boolean isFourWheelType() {
return typeWeight != TrafficTypeEnum.TYPE_TRAFFIC_ID_PEOPLE.getType()
&& typeWeight != TrafficTypeEnum.TYPE_TRAFFIC_ID_BICYCLE.getType()
&& typeWeight != TrafficTypeEnum.TYPE_TRAFFIC_ID_MOTO.getType();
}
private double[] getCenterPoint(List<ObjQueue> objQueueList) {
int total = objQueueList.size();
double X = 0, Y = 0, Z = 0;
@@ -202,12 +166,18 @@ public class TrackObj {
return d;
}
public void clear(){
circleQueue.clear();
s2CellId = null;
s2LatLng = null;
typeArray = null;
}
@Override
public String toString() {
return "TrackObj{" +
"circleQueue=" + circleQueue +
", s2CellId=" + s2CellId +
", recentlyTime=" + recentlyTime +
", cacheData=" + cacheData +
'}';
}

View File

@@ -64,7 +64,7 @@ object TrackerSourceColorHelper {
//僵尸车
if(data.addAttribute == AdditionalAttribute.ATTR_ZOMBIE){
color = "#8F9AADFF"
color = "#AE7887FF"
}
// pnc预警

View File

@@ -139,6 +139,12 @@ object WarningHelper {
}
}
fun remove(key:String){
pncWarningBeautyTrafficData.remove(key)
pncWarningOriginTrafficData.remove(key)
obuWarningTrafficData.remove(key)
}
fun clear() {
pncWarningBeautyTrafficData.clear()
pncWarningOriginTrafficData.clear()

View File

@@ -1,5 +1,6 @@
package com.mogo.eagle.core.data.config
import chassis.Chassis
import com.mogo.eagle.core.data.deva.net.UrlConfig
import com.mogo.eagle.core.utilcode.util.GsonUtils
@@ -213,4 +214,10 @@ object FunctionBuildConfig {
@JvmField
var urlJson: UrlConfig = GsonUtils.fromJson("{\"och_url\":\"https://tech.zhidaohulian.com\"}", UrlConfig::class.java)
/**
* 最外层设置的Url
*/
@Volatile
@JvmField
var unableLaunchAutopilotGear: Set<Chassis.GearPosition>? = null
}

View File

@@ -105,6 +105,11 @@ interface IDevaToolsProvider : IProvider {
*/
fun showFeedbackWindow(ctx: Context)
/**
* 展示录包管理页面
*/
fun showBadCaseManagerView(context: Context)
/**
* 下载指定包
*/

View File

@@ -141,6 +141,13 @@ object CallerDevaToolsManager {
devaToolsProviderApi?.showFeedbackWindow(ctx)
}
/**
* 展示录包管理页面
*/
fun showBadCaseManagerView(context: Context){
devaToolsProviderApi?.showBadCaseManagerView(context)
}
/**
* 下载指定包
*/

View File

@@ -4,6 +4,9 @@ import com.zhidao.support.adas.high.common.autopilot.ability.AutopilotAbilityMan
import com.zhidao.support.adas.high.subscribe.SubscribeInterfaceOptions;
import java.util.HashSet;
import java.util.Set;
import chassis.Chassis;
/**
* Date2019/5/31。
@@ -126,13 +129,13 @@ public class AdasOptions {
}
/**
* 身份/车型
* 不能启动自驾的档位
*
* @param identityMode 车型
* @param unableLaunchAutopilotGear 档位
* @return
*/
public Builder setIdentityMode(String identityMode) {
options.setIdentityMode(identityMode);
public Builder setUnableLaunchAutopilotGear(Set<Chassis.GearPosition> unableLaunchAutopilotGear) {
options.setUnableLaunchAutopilotGear(unableLaunchAutopilotGear);
return this;
}
@@ -153,7 +156,7 @@ public class AdasOptions {
options.ipcAssignIP = null;
options.ipcFixationIP = null;
options.subscribeInterfaceOptions = null;
options.setIdentityMode("");
options.setUnableLaunchAutopilotGear(null);
return options;
}
@@ -197,7 +200,7 @@ public class AdasOptions {
this.subscribeInterfaceOptions = subscribeInterfaceOptions;
}
public void setIdentityMode(String identityMode) {
AutopilotAbilityManager.getInstance().setIdentityMode(identityMode);
public void setUnableLaunchAutopilotGear(Set<Chassis.GearPosition> unableLaunchAutopilotGear) {
AutopilotAbilityManager.getInstance().setUnableLaunchAutopilotGear(unableLaunchAutopilotGear);
}
}

View File

@@ -1,10 +1,7 @@
package com.zhidao.support.adas.high.common.autopilot.ability;
import com.zhidao.support.adas.high.OnAdasListener;
import java.util.Timer;
import java.util.TimerTask;
import java.util.regex.Pattern;
import chassis.Chassis;
import chassis.ChassisStatesOuterClass;
@@ -31,10 +28,6 @@ public class AutopilotAbility230 {
}
private void onCallback() {
//金旅、开沃小巴乘客端 不能启动自动驾驶
if (AutopilotAbilityManager.getInstance().isBusPassenger()) {
return;
}
boolean isAutopilotAbility = true;//是否能启动自动驾驶
String unableAutopilotReason = null;//不能启动自动驾驶原因
//检测底盘相关
@@ -47,36 +40,14 @@ public class AutopilotAbility230 {
}
}
if (isAutopilotAbility) {
/**
* 档位状态判断 目前判断的车型包括 东风Taxi 红旗Taxi 金旅Bus 金旅M1 金旅M1 福田清扫车 开沃
* TODO 如果 identityMode 未赋值以及目前已知其他车型判断逻辑跟东风Taxi和红旗 走
*/
//开沃任何档位都能启动自驾
if (!AutopilotAbilityManager.getInstance().isBusDriverVan()) {
if (chassisStates.hasGearSystemStates()) {
Chassis.GearPosition gear = chassisStates.getGearSystemStates().getGearPosition();
//金旅Bus和清扫车 档位不正常
if (AutopilotAbilityManager.getInstance().isBusDriver()) {
if (gear == Chassis.GearPosition.GEAR_N || gear == Chassis.GearPosition.GEAR_R) {
isAutopilotAbility = false;
unableAutopilotReason = "档位不正常";
}
} else if (AutopilotAbilityManager.getInstance().isSweeperDriverFutian()) {
if (gear == Chassis.GearPosition.GEAR_N) {
isAutopilotAbility = false;
unableAutopilotReason = "档位不正常";
}
} else {
//东风Taxi和红旗 司机端和乘客端 档位不正常
if (gear == Chassis.GearPosition.GEAR_P || gear == Chassis.GearPosition.GEAR_R) {
isAutopilotAbility = false;
unableAutopilotReason = "档位不正常";
}
}
if (chassisStates.hasGearSystemStates()) {
Chassis.GearPosition gear = chassisStates.getGearSystemStates().getGearPosition();
if (!AutopilotAbilityManager.getInstance().isLaunchAutopilot(gear)) {
isAutopilotAbility = false;
unableAutopilotReason = "档位不正常";
}
}
}
//TODO 关于手刹:不同车型的实现不同所以目前没法使用此字段
// if (isAutopilotAbility) {
// //电子驻车制动系统
@@ -88,9 +59,7 @@ public class AutopilotAbility230 {
// }
// }
}
if (AutopilotAbilityManager.getInstance().getListener() != null) {
AutopilotAbilityManager.getInstance().getListener().onAutopilotAbility(isAutopilotAbility, unableAutopilotReason);
}
AutopilotAbilityManager.getInstance().onAutopilotAbility(isAutopilotAbility, unableAutopilotReason);
}
public synchronized void start() {
@@ -114,5 +83,4 @@ public class AutopilotAbility230 {
}
}

View File

@@ -45,10 +45,6 @@ public class AutopilotAbility250 {
}
private void onCallback(SystemStatusInfo.StatusInfo statusInfo) {
//金旅、开沃小巴乘客端 不能启动自动驾驶
if (AutopilotAbilityManager.getInstance().isBusPassenger()) {
return;
}
boolean isAutopilotAbility = true;//是否能启动自动驾驶
String unableAutopilotReason = null;//不能启动自动驾驶原因
//检测节点状态相关
@@ -122,36 +118,14 @@ public class AutopilotAbility250 {
}
}
if (isAutopilotAbility) {
/**
* 档位状态判断 目前判断的车型包括 东风Taxi 红旗Taxi 金旅Bus 金旅M1 金旅M1 福田清扫车 开沃
* TODO 如果 identityMode 未赋值以及目前已知其他车型判断逻辑跟东风Taxi和红旗 走
*/
//开沃任何档位都能启动自驾
if (!AutopilotAbilityManager.getInstance().isBusDriverVan()) {
if (chassisStates.hasGearSystemStates()) {
Chassis.GearPosition gear = chassisStates.getGearSystemStates().getGearPosition();
//金旅Bus和清扫车 档位不正常
if (AutopilotAbilityManager.getInstance().isBusDriver()) {
if (gear == Chassis.GearPosition.GEAR_N || gear == Chassis.GearPosition.GEAR_R) {
isAutopilotAbility = false;
unableAutopilotReason = "档位不正常";
}
} else if (AutopilotAbilityManager.getInstance().isSweeperDriverFutian()) {
if (gear == Chassis.GearPosition.GEAR_N) {
isAutopilotAbility = false;
unableAutopilotReason = "档位不正常";
}
} else {
//东风Taxi和红旗 司机端和乘客端 档位不正常
if (gear == Chassis.GearPosition.GEAR_P || gear == Chassis.GearPosition.GEAR_R) {
isAutopilotAbility = false;
unableAutopilotReason = "档位不正常";
}
}
if (chassisStates.hasGearSystemStates()) {
Chassis.GearPosition gear = chassisStates.getGearSystemStates().getGearPosition();
if (!AutopilotAbilityManager.getInstance().isLaunchAutopilot(gear)) {
isAutopilotAbility = false;
unableAutopilotReason = "档位不正常";
}
}
}
//TODO 关于手刹:不同车型的实现不同所以目前没法使用此字段
// if (isAutopilotAbility) {
// //电子驻车制动系统
@@ -163,9 +137,7 @@ public class AutopilotAbility250 {
// }
// }
}
if (AutopilotAbilityManager.getInstance().getListener() != null) {
AutopilotAbilityManager.getInstance().getListener().onAutopilotAbility(isAutopilotAbility, unableAutopilotReason);
}
AutopilotAbilityManager.getInstance().onAutopilotAbility(isAutopilotAbility, unableAutopilotReason);
}
public synchronized void start() {

View File

@@ -10,11 +10,13 @@ import com.zhidao.support.adas.high.OnAdasListener;
import com.zhidao.support.adas.high.common.Constants;
import com.zhidao.support.adas.high.common.CupidLogUtils;
import java.util.Set;
import java.util.Timer;
import java.util.TimerTask;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import chassis.Chassis;
import chassis.ChassisStatesOuterClass;
import mogo.telematics.pad.MessagePad;
import system_master.SystemStatusInfo;
@@ -38,37 +40,14 @@ public class AutopilotAbilityManager {
private AutopilotAbility250 autopilotAbility250;
private Timer startTimer;
/**
* 身份/车型
* 不能启动自动驾驶的档位
*/
private String identityMode;
private Set<Chassis.GearPosition> unableLaunchAutopilotGear;
public interface OnAutopilotAbilityListener {
void onStatusQuery();//查询是被调用
}
/**
* 身份规则定义根据app/productFlavors/README.md
* * taxi司机屏 Taxi_Driver_Base (东风、红旗司机端)
* * taxi乘客屏 Taxi_Passenger_Base (东风、红旗乘客端)
* * bus司机屏 Bus_Driver_Base (金旅小巴司机端)
* * Bus_Driver_Van (开沃小巴司机端)
* * bus乘客屏 Bus_Passenger_Base (金旅、开沃小巴乘客端)
* * Bus_Passenger_M1 M1小巴乘客端
* * Bus_Passenger_M2 M2小巴乘客端
* * 清扫车 Sweeper_Driver_FT (福田清扫车司机端)
* <p>
* 此定义不区分角色,只区分业务线和车型
*/
private interface IDENTITY_MODE {
String TAXI_DRIVER_BASE = "Taxi_Driver_Base";//(东风、红旗司机端)
String TAXI_PASSENGER_BASE = "Taxi_Passenger_Base";//(东风、红旗乘客端)
String BUS_DRIVER_BASE = "Bus_Driver_Base";//(金旅小巴司机端)
String BUS_DRIVER_VAN = "Bus_Driver_Van";//(开沃小巴司机端)
String BUS_PASSENGER_BASE = "Bus_Passenger_Base";//(金旅、开沃小巴乘客端)
String BUS_PASSENGER_M1 = "Bus_Passenger_M1";//M1小巴乘客端
String BUS_PASSENGER_M2 = "Bus_Passenger_M2";//M2小巴乘客端
String SWEEPER_DRIVER_FT = "Sweeper_Driver_FT";//(福田清扫车司机端)
}
private AutopilotAbilityManager() {
}
@@ -84,8 +63,22 @@ public class AutopilotAbilityManager {
return INSTANCE;
}
public void setIdentityMode(String identityMode) {
this.identityMode = identityMode;
public void setUnableLaunchAutopilotGear(Set<Chassis.GearPosition> unableLaunchAutopilotGear) {
this.unableLaunchAutopilotGear = unableLaunchAutopilotGear;
}
/**
* 获取当前档位是否能启动自动驾驶 如果不传递默认可以启动
* 不能启动自驾档位规则app/README.md/不能启动自动驾驶的档位
*
* @param currentGear 当前档位
* @return 是否能启动自驾
*/
public boolean isLaunchAutopilot(Chassis.GearPosition currentGear) {
if (unableLaunchAutopilotGear != null && !unableLaunchAutopilotGear.isEmpty()) {
return !unableLaunchAutopilotGear.contains(currentGear);
}
return true;
}
public void setCarConfig(MessagePad.CarConfigResp carConfig) {
@@ -105,8 +98,10 @@ public class AutopilotAbilityManager {
this.listener = listener;
}
public OnAdasListener getListener() {
return listener;
public void onAutopilotAbility(boolean isAutopilotAbility, String unableAutopilotReason) {
if (listener != null) {
listener.onAutopilotAbility(isAutopilotAbility, unableAutopilotReason);
}
}
public void setHandler(Handler handler) {
@@ -243,32 +238,4 @@ public class AutopilotAbilityManager {
}
return version;
}
/**
* 金旅、开沃小巴乘客端
*/
public boolean isBusPassenger() {
return IDENTITY_MODE.BUS_PASSENGER_BASE.equalsIgnoreCase(identityMode);
}
/**
* 开沃小巴司机端
*/
public boolean isBusDriverVan() {
return IDENTITY_MODE.BUS_DRIVER_VAN.equalsIgnoreCase(identityMode);
}
/**
* 金旅小巴司机端
*/
public boolean isBusDriver() {
return IDENTITY_MODE.BUS_DRIVER_BASE.equalsIgnoreCase(identityMode);
}
/**
* 福田清扫车司机端
*/
public boolean isSweeperDriverFutian() {
return IDENTITY_MODE.SWEEPER_DRIVER_FT.equalsIgnoreCase(identityMode);
}
}

View File

@@ -46,6 +46,11 @@ public interface IMogoMap {
*/
IMogoMarker addMarker(String tag, MogoMarkerOptions options);
/**
* 清除所有marker
*/
void clearAllMarkers();
/**
* 批量更新锚点位置
*

View File

@@ -38,6 +38,11 @@ public interface IMogoMarkerManager {
*/
List<IMogoMarker> addMarkers(String tag, ArrayList<MogoMarkerOptions> options, boolean moveToCenter);
/**
* 清除所有marker
*/
void clearAllMarker();
/**
* 批量更新锚点位置
*

View File

@@ -3,10 +3,10 @@ package com.mogo.map;
import android.annotation.SuppressLint;
import android.content.Context;
import android.graphics.Point;
import android.util.Log;
import android.util.Pair;
import com.mogo.eagle.core.data.config.FunctionBuildConfig;
import com.mogo.eagle.core.data.map.MogoLatLng;
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
import com.mogo.map.center.CenterLine;
import com.mogo.map.marker.AMapInfoWindowAdapter;
@@ -108,6 +108,13 @@ public class AMapWrapper implements IMogoMap {
return mogoMarker;
}
@Override
public void clearAllMarkers() {
if (sAMap != null) {
sAMap.clearAllMarkers();
}
}
@SuppressLint("NewApi")
@Override
public void updateBatchMarkerPosition(HashMap<String, MessagePad.TrackedObject> optionsArrayList) {
@@ -119,6 +126,9 @@ public class AMapWrapper implements IMogoMap {
MarkerSimpleData markerOptions = ObjectUtils.fromTrafficData(trackedObject);
if (markerOptions != null) {
markerOptionsArrayList.add(markerOptions);
if(markerOptions.id == 65061){
Log.i("emArrow","time :" + markerOptions.time + " , lat : " + markerOptions.lat + " , lon : " + markerOptions.lon);
}
}
});
long time = markerOptionsArrayList.get(0).getTime();

View File

@@ -71,6 +71,15 @@ public class MogoMarkerManager implements IMogoMarkerManager {
}
}
@Override
public void clearAllMarker() {
try{
MogoMap.getInstance().getMogoMap().clearAllMarkers();
}catch (Exception e){
e.printStackTrace();
}
}
@Override
public void updateBatchMarkerPosition(HashMap<String, MessagePad.TrackedObject> optionsArrayList) {
try {