Merge branch 'dev/dev_eagle_architecture_upgrade' into dev/dev_eagle_wuhan_sikua_obu

# Conflicts:
#	core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/hmi/warning/IMoGoWaringProvider.kt
#	libraries/map-custom/src/main/java/com/mogo/map/impl/custom/CustomMapApiBuilder.java
#	modules/mogo-module-common/src/main/java/com/mogo/module/common/enums/WarningTypeEnum.kt
#	modules/mogo-module-hmi/build.gradle
#	modules/mogo-module-hmi/src/main/java/com/mogo/module/hmi/notification/WarningFloat.kt
#	modules/mogo-module-hmi/src/main/java/com/mogo/module/hmi/notification/WarningNotificationConfig.kt
#	modules/mogo-module-hmi/src/main/java/com/mogo/module/hmi/ui/MoGoWarningContract.kt
#	modules/mogo-module-hmi/src/main/java/com/mogo/module/hmi/ui/MoGoWarningFragment.kt
#	modules/mogo-module-hmi/src/main/java/com/mogo/module/hmi/ui/widget/V2XWarningView.kt
#	modules/mogo-module-hmi/src/main/java/com/mogo/module/hmi/warning/MoGoWarningProvider.java
#	modules/mogo-module-obu-mogo/build.gradle
#	modules/mogo-module-obu-mogo/src/main/java/com/mogo/module/obu/mogo/MogoPrivateObuManager.kt
#	services/mogo-service-api/build.gradle
#	settings.gradle
This commit is contained in:
董宏宇
2021-09-16 19:13:24 +08:00
1264 changed files with 4947 additions and 28650 deletions

View File

@@ -1,30 +0,0 @@
package com.mogo.module.adas;
/**
* @author donghongyu
* @date 4/21/21 2:52 PM
*/
public class 占位文件可删除 {
/** TODO 本模块提供能力范围
* 1、与工控机数据交互具体能力与 @宋克难 沟通
* a、建立车机与工控机的数据通路
* b、保证数据通路的稳定性
*
* 2、暴露API接口共上层业务使用
* a、上层业务可主动订阅、取消订阅数据
* b、自动驾驶控制下发
* b、自动驾驶状态获取
* c、自动驾驶规划路径下发
* e、ADAS识别报警
*
* 3、项目中已经使用到的ADAS数据的业务如下可参考下面业务层使用情况来封装本模块的API
* AdasControlCommandParameter
* AdasLogWriter
* AdasObjectUtils
* CarModelInfoNetApiServices
* LogWriter
* MogoADASController
* OnAdasListenerAdapter
*/
}

View File

@@ -0,0 +1,37 @@
# 状态检测模块
硬件检测范围
主激光雷达
侧激光雷达-2个
ADAS长焦摄像头-前
ADAS广角摄像头-前
ADAS标准摄像头-前
ADAS广角摄像头-后
RTK设备
OUB设备
PAD
路由器
自动驾驶软件检测范围 节点
车控节点
轨迹地图加载节点
轨迹规划节点
定位转化节点
融合节点
yolov5节点包含红绿灯检测
激光雷达渲染节点
摄像头驱动节点
gnss定位驱动节点
中激光驱动节点
左激光解码节点
左激光驱动节点
右激光解码节点
右激光驱动节点
监控节点
通讯交互节点
轨迹录制节点
can车辆控制节点
鹰眼
版本更新
自动驾驶版本
鹰眼版本

View File

@@ -1,30 +1,25 @@
apply plugin: 'com.android.library'
apply plugin: 'com.alibaba.arouter'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'com.alibaba.arouter'
apply plugin: 'kotlin-kapt'
android {
compileSdkVersion rootProject.ext.android.compileSdkVersion
defaultConfig {
minSdkVersion rootProject.ext.android.minSdkVersion
targetSdkVersion rootProject.ext.android.targetSdkVersion
versionCode Integer.valueOf(VERSION_CODE)
versionName getValueFromRootProperties("${project.name.replace("-", "_").toUpperCase()}_VERSION")
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
consumerProguardFiles 'consumer-rules.pro'
//ARouter apt
kapt {
useBuildCache = false
arguments {
arg("AROUTER_MODULE_NAME",project.getName() )
javaCompileOptions {
annotationProcessorOptions {
arguments = [AROUTER_MODULE_NAME: project.getName()]
}
}
}
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
consumerProguardFiles 'consumer-rules.pro'
}
buildTypes {
release {
minifyEnabled false
@@ -41,30 +36,38 @@ android {
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation rootProject.ext.dependencies.kotlinstdlibjdk7
implementation rootProject.ext.dependencies.androidxccorektx
implementation rootProject.ext.dependencies.coroutinescore
implementation rootProject.ext.dependencies.coroutinesandroid
implementation rootProject.ext.dependencies.androidxappcompat
implementation rootProject.ext.dependencies.androidxrecyclerview
implementation rootProject.ext.dependencies.androidxconstraintlayout
implementation rootProject.ext.dependencies.androidxviewpager2
implementation rootProject.ext.dependencies.arouter
kapt rootProject.ext.dependencies.aroutercompiler
implementation rootProject.ext.dependencies.indicator
implementation rootProject.ext.dependencies.callchatprovider
implementation rootProject.ext.dependencies.coroutinesandroid
implementation rootProject.ext.dependencies.coroutinescore
implementation rootProject.ext.dependencies.kotlinstdlibjdk7
implementation 'com.google.android.material:material:1.2.1'
implementation project(':modules:mogo-module-common')
implementation project(path: ':modules:mogo-module-service')
annotationProcessor rootProject.ext.dependencies.aroutercompiler
if (Boolean.valueOf(RELEASE)) {
implementation rootProject.ext.dependencies.mogoutils
implementation rootProject.ext.dependencies.mogocommons
implementation rootProject.ext.dependencies.mogoserviceapi
implementation rootProject.ext.dependencies.mogomoduleauth
implementation rootProject.ext.dependencies.modulecommon
api rootProject.ext.dependencies.mogomap
api rootProject.ext.dependencies.mogomapapi
api rootProject.ext.dependencies.mogoutils
api rootProject.ext.dependencies.mogocommons
api rootProject.ext.dependencies.mogoserviceapi
} else {
implementation project(":foudations:mogo-utils")
implementation project(":foudations:mogo-commons")
implementation project(':services:mogo-service-api')
implementation project(':modules:mogo-module-authorize')
implementation project(":modules:mogo-module-common")
api project(":libraries:mogo-map")
api project(":libraries:mogo-map-api")
api project(":foudations:mogo-utils")
api project(":foudations:mogo-commons")
api project(':services:mogo-service-api')
}
implementation 'com.tencent.bugly:crashreport_upgrade:latest.release'
//latest.release指代最新Bugly SDK版本号2.1.9
implementation 'com.tencent.bugly:nativecrashreport:latest.release'
//latest.release指代最新Bugly NDK版本号3.0
}
apply from: new File(rootProject.rootDir, "gradle/upload.gradle").toString()
apply from: new File(rootProject.rootDir, "gradle/upload.gradle").toString()

View File

@@ -1,3 +1,3 @@
GROUP=com.mogo.module
POM_ARTIFACT_ID=module-guide
POM_ARTIFACT_ID=module-check
VERSION_CODE=1

View File

@@ -18,4 +18,4 @@
# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
#-renamesourcefileattribute SourceFile

View File

@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.mogo.module.check">
<application>
<activity
android:name=".view.CheckActivity"
android:launchMode="singleTask"
android:screenOrientation="landscape" />
</application>
</manifest>

View File

@@ -0,0 +1,92 @@
package com.mogo.module.check;
import android.content.Context;
import android.util.Log;
import com.alibaba.android.arouter.facade.annotation.Route;
import com.mogo.map.check.IMogoCheckListener;
import com.mogo.module.check.view.CheckActivity;
import com.mogo.service.check.ICheckProvider;
import com.mogo.service.MogoServicePaths;
import com.mogo.service.v2x.IV2XWarningListener;
import com.mogo.utils.logger.Logger;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.CopyOnWriteArrayList;
/**
* 鹰眼系统、自动驾驶系统 检测模块
*
* @date 4/21/21 3:39 PM
* 需求地址
* wikihttp://wiki.zhidaohulian.com/pages/viewpage.action?pageId=58204952
*/
@Route(path = MogoServicePaths.PATH_CHECK)
public class VehicleMonitoringManager implements ICheckProvider {
private static final String TAG = "VehicleMonitoringManager";
private Context mContext;
private final Map<String, CopyOnWriteArrayList> mListeners = new ConcurrentHashMap<>();
@Override
public void init(Context context) {
Logger.d(TAG, "初始化 CheckProvider 模块");
mContext = context;
}
@Override
public void registerVehicleMonitoringListener(String module, IMogoCheckListener listener) {
if (listener == null || module == null) {
Log.d(TAG, "listener == null || intent == null");
return;
}
if (!mListeners.containsKey(module)) {
Log.d(TAG, "intent==" + module + "listener" + listener);
mListeners.put(module, new CopyOnWriteArrayList<>());
}
mListeners.get(module).add(listener);
}
@Override
public void unregisterListener(String module, IMogoCheckListener listener) {
if (mListeners.containsKey(module)) {
mListeners.get(module).remove(listener);
}
}
@Override
public void startCheckActivity(Context context) {
if (context != null) {
CheckActivity.start(context);
}
}
@Override
public void showCheckDialog(Context context) {
if (context != null) {
CheckActivity.showDialog(context);
}
}
@Override
public boolean checkMonitor(Context context) {
if (context != null) {
return CheckActivity.checkMonitor();
}
return false;
}
@Override
public void updateMonitoringStatus(String module, boolean hasError) {
List<IMogoCheckListener> listeners = mListeners.get(module);
if (listeners != null && !listeners.isEmpty()) {
for (IMogoCheckListener listener : listeners) {
if (listener != null) {
listener.updateMonitoringStatus(hasError);
}
}
}
}
}

View File

@@ -0,0 +1,19 @@
package com.mogo.module.check.api;
/**
* @author liujing
* @description 描述
* @since: 8/6/21
*/
public interface ICheckListener {
/**
* 工控机->鹰眼定位数据延时
*/
void getAutoLocationTimeCallbackDelayed(long time);
/**
* 工控机->鹰眼识别数据延时
*/
void getAutoDataCallbackDelayed(long time);
}

View File

@@ -0,0 +1,23 @@
package com.mogo.module.check.api;
/**
* @author xiaoyuzhou
* @date 2021/7/5 2:54 下午
* <p>
* 软件环境检测
* -----> 自动驾驶版本
* -----> 鹰眼版本
*/
public interface SoftCheckApi {
/**
* 检测「自动驾驶」版本
*/
void checkAutoPilotSoftVersion();
/**
* 检测「鹰眼」版本
*/
void checkEagleEyeSoftVersion();
}

View File

@@ -0,0 +1,135 @@
package com.mogo.module.check.model;
import com.tencent.bugly.proguard.A;
import java.io.Serializable;
import java.util.ArrayList;
/**
* @author liujing
* @description 描述
* @since: 7/28/21
*/
public class CheckItemInfo implements Serializable {
//view类型
private int style;
//view顶端标题
private String viewTitle;
//icon 下第一行title 自动驾驶软件\鹰眼系统
private String title;
private String value;
private ArrayList itemList;
//是否存在异常
private boolean usual;
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public ArrayList getItemList() {
return itemList;
}
public void setItemList(ArrayList itemList) {
this.itemList = itemList;
}
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
public boolean isUsual() {
return usual;
}
public void setUsual(boolean usual) {
this.usual = usual;
}
public int getStyle() {
return style;
}
public void setStyle(int style) {
this.style = style;
}
public String getViewTitle() {
return viewTitle;
}
public void setViewTitle(String viewTitle) {
this.viewTitle = viewTitle;
}
@Override
public String toString() {
return "CheckItemInfo{" +
"style=" + style +
", viewTitle='" + viewTitle + '\'' +
", title='" + title + '\'' +
", value='" + value + '\'' +
", itemList=" + itemList +
", usual=" + usual +
'}';
}
public static class DetailItem implements Serializable {
private boolean usual;
private String title;
private String value;
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
public boolean isUsual() {
return usual;
}
public void setUsual(boolean usual) {
this.usual = usual;
}
@Override
public String toString() {
return "DetailItem{" +
"usual=" + usual +
", title='" + title + '\'' +
", value='" + value + '\'' +
'}';
}
}
public interface CheckAdapterStyleEnum {
int ITEM_TYPE_CHECK_TITLE = 0;
int ITEM_TYPE_CHECK_LIST = 1;
int ITEM_TYPE_CHECK_IMAGE = 2;
}
}

View File

@@ -0,0 +1,10 @@
package com.mogo.module.check.net;
/**
* @author liujing
* @description 描述
* @since: 8/13/21
*/
public class CheckApiServiceFactory {
}

View File

@@ -0,0 +1,17 @@
package com.mogo.module.check.net;
import android.database.Observable;
import java.util.Map;
import retrofit2.http.FieldMap;
import retrofit2.http.POST;
/**
* @author liujing
* @description 描述
* @since: 8/13/21
*/
public interface CheckApiServices {
@POST("/yycp-vehicle-management-service/monitor/reciveInfo")
Observable<CheckResultData> uploadCheckDetail(@FieldMap Map<String, String> param);
}

View File

@@ -0,0 +1,11 @@
package com.mogo.module.check.net;
import com.mogo.commons.data.BaseData;
/**
* @author liujing
* @description 描述
* @since: 8/13/21
*/
public class CheckResultData extends BaseData {
}

View File

@@ -0,0 +1,581 @@
package com.mogo.module.check.view;
import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.animation.AnimatorSet;
import android.animation.ObjectAnimator;
import android.animation.ValueAnimator;
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.graphics.Rect;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.ImageView;
import android.widget.ProgressBar;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import androidx.recyclerview.widget.RecyclerView;
import com.mogo.commons.voice.AIAssist;
import com.mogo.map.check.IMogoCheckListener;
import com.mogo.module.check.R;
import com.mogo.module.check.model.CheckItemInfo;
import com.mogo.module.common.MogoApisHandler;
import com.mogo.module.common.view.ImageViewClipBounds;
import com.mogo.module.common.view.SpacesItemDecoration;
import com.mogo.module.service.receiver.MogoReceiver;
import com.mogo.utils.CommonUtils;
import com.mogo.utils.network.utils.NetworkStatusUtil;
import com.tencent.bugly.beta.Beta;
import com.tencent.bugly.beta.UpgradeInfo;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.concurrent.TimeUnit;
/**
* @author liujing
* @description 车辆监控页面
* @since: 7/27/21
*/
public class CheckActivity extends AppCompatActivity {
private static final String TAG = "CheckActivity";
private RecyclerView mRecyclerView;
private static ArrayList dataArrayList = new ArrayList();
private static Context context;
private static NetworkStatusUtil.NetWorkStatus sNetWorkStatus;
private ImageView mImageView;
private static String packageName = "com.mogo.launcher.f";
//车模
private ImageView scanBottomCarImage;
//扫描束
private ImageView scanLineImage;
//车辆模型顶部色值加深车模
private ImageViewClipBounds scanTopImageView;
//车模顶部小部件图片
private ImageViewClipBounds tipsImageView;
//动画组
private AnimatorSet setAnimation = null;
private ValueAnimator mValueAnimator;
private float movement = 1162f;
//进度条
private ProgressBar mProgressBar;
private final static long DURATION_TIME = 3000;
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_check);
initView();
}
/**
* 列表View初始化
*/
public void initView() {
setAnimation = new AnimatorSet();
mImageView = findViewById(R.id.btnBack);
scanBottomCarImage = findViewById(R.id.scan_car_image);
scanLineImage = findViewById(R.id.scan_line_image);
scanTopImageView = findViewById(R.id.scan_car_top_image);
tipsImageView = findViewById(R.id.scan_car_tips);
mProgressBar = findViewById(R.id.check_progress);
context = mImageView.getContext();
packageName = getPackageName(context);
mImageView.setOnClickListener(v -> {
finish();
});
//检测动画
animation();
//版本检测 和系统检查放在第二期
// versionCheckResult();
// //系统检测
// systemCheckResult();
//软件检测
software();
//硬件检测
hardware();
//根据以上4个结果插入第一个元素(自动驾驶车辆是否存在风险)
topListTitle();
mRecyclerView = findViewById(R.id.check_list);
mRecyclerView.setAdapter(new CheckAdapter(context, dataArrayList));
CheckLinearLayout linearLayoutManager =
new CheckLinearLayout(this, CheckLinearLayout.VERTICAL, false);
mRecyclerView.addItemDecoration(new SpacesItemDecoration((int) getResources().getDimension(R.dimen.check_item_space_vr)));
mRecyclerView.setLayoutManager(linearLayoutManager);
}
/**
* 自动驾驶状态下指标监测
*/
public static boolean checkMonitor() {
dataArrayList.clear();
Log.d(TAG, "checkMonitor");
//版本检测
// versionCheckResult();
// //系统检测
// systemCheckResult();
//软件检测
software();
//硬件检测
hardware();
//根据以上4个结果插入第一个元素(自动驾驶车辆是否存在风险)
topListTitle();
MogoApisHandler.getInstance().getApis().getCheckProvider().updateMonitoringStatus(MogoReceiver.ACTION_CHECK_VEHICLE_MONITORING,false);
return true;
}
/**
* 自动驾驶是否存在风险
*/
private static void topListTitle() {
ArrayList list = new ArrayList(1);
CheckItemInfo info = new CheckItemInfo();
info.setUsual(false);
info.setTitle("自动驾驶车辆存在风险");
info.setStyle(CheckItemInfo.CheckAdapterStyleEnum.ITEM_TYPE_CHECK_TITLE);
list.add(info);
dataArrayList.add(0, list);
}
/**
* @param context
* @return 当前应用的版本名称
*/
public static synchronized String getPackageName(Context context) {
try {
PackageManager packageManager = context.getPackageManager();
PackageInfo packageInfo = packageManager.getPackageInfo(
context.getPackageName(), 0);
Log.d(TAG, "包名:" + packageInfo.packageName);
return packageInfo.packageName;
} catch (Exception e) {
e.printStackTrace();
}
return "com.mogo.launcher.f";
}
/**
* **************************************************************************************检测动画
*/
public void animation() {
ObjectAnimator animatorX = ObjectAnimator.ofFloat(scanLineImage, "translationX", scanBottomCarImage.getWidth(), 0);
ObjectAnimator animatorAl = ObjectAnimator.ofFloat(scanLineImage, "alpha", 0, 1);
setAnimation.playTogether(animatorX, animatorAl);
setAnimation.setDuration(800);
setAnimation.start();
setAnimation.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
super.onAnimationEnd(animation);
if (scanTopImageView != null) {
movement = (float) scanTopImageView.getWidth();
scanLineImage.setVisibility(View.VISIBLE);
scanTopImageView.setVisibility(View.VISIBLE);
tipsImageView.setVisibility(View.VISIBLE);
}
if (scanLineImage != null) {
scanLineImage
.animate()
.translationX(movement)
.setDuration(DURATION_TIME)
.setListener(new Animator.AnimatorListener() {
@Override
public void onAnimationStart(Animator animation) {
animatorScanCarBorder(true, scanTopImageView.getWidth());
}
@Override
public void onAnimationEnd(Animator animation) {
}
@Override
public void onAnimationCancel(Animator animation) {
}
@Override
public void onAnimationRepeat(Animator animation) {
}
}).start();
}
}
});
}
/**
* 扫描动画:实现扫描束位移+顶部深色车模及检测元件的显示
*/
public void animatorScanCarBorder(boolean show, int weight) {
if (show) {
mValueAnimator = ValueAnimator.ofInt(0, weight);
} else {
}
mValueAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
@Override
public void onAnimationUpdate(ValueAnimator animation) {
Rect rect = new Rect(0, 0, (int) mValueAnimator.getAnimatedValue(), scanTopImageView.getHeight());
setProgressBarRefresh((int) mValueAnimator.getAnimatedValue());
scanTopImageView.setClip(rect);
tipsImageView.setClip(rect);
}
});
mValueAnimator.setDuration(DURATION_TIME);
mValueAnimator.start();
}
/**
* 进度条状态刷新
*/
public void setProgressBarRefresh(int animateValue) {
if (mProgressBar != null) {
double scale = new BigDecimal((float) animateValue / scanBottomCarImage.getWidth())
.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue() * 100;
if (mProgressBar.getProgress() < 100) {
mProgressBar.setProgress((int) scale);
} else {
findViewById(R.id.animationLayout).setVisibility(View.GONE);
}
}
}
/**
* **************************************************************************************版本检测
*/
public static void versionCheckResult() {
ArrayList arrayVer = new ArrayList();
//adas 检测指标
//鹰眼当前版本
String verCodeStr = CommonUtils.getVersionName(context, true);
Log.d(TAG, "版本检测结果:鹰眼" + verCodeStr);
//测试数据
CheckItemInfo itemInfo = new CheckItemInfo();
itemInfo.setViewTitle("版本检测:");
itemInfo.setTitle("自动驾驶升级到\n 版本3.1.2.7");
if ("不是最新版本" != null) {
itemInfo.setUsual(false);
itemInfo.setValue("版本升级");
} else {
itemInfo.setUsual(true);
itemInfo.setValue("最新版本 无风险");
}
arrayVer.add(itemInfo);
CheckItemInfo yingyan = new CheckItemInfo();
UpgradeInfo upgradeInfo = Beta.getUpgradeInfo();
if (upgradeInfo == null) {
yingyan.setUsual(true);
yingyan.setTitle(" 鹰眼 \n版本" + verCodeStr);
yingyan.setValue("最新版本 无风险");
} else {
yingyan.setUsual(false);
yingyan.setTitle(" 鹰眼升级到 \n版本" + upgradeInfo.versionName);
yingyan.setValue("版本升级");
}
arrayVer.add(yingyan);
dataArrayList.add(arrayVer);
}
/**
* **************************************************************************************系统检测
*/
public static void systemCheckResult() {
ArrayList arrSys = new ArrayList();
//网络
netStatus();
//电量
float battery = CommonUtils.getBattery(context);
//cpu占比
double cpu = CommonUtils.getCPU(packageName);
//内存占比
double memory = CommonUtils.getMemory(packageName);
//风险状态
CheckItemInfo itemInfo = new CheckItemInfo();
itemInfo.setViewTitle("系统检测:");
itemInfo.setTitle("自动驾驶系统");
itemInfo.setUsual(false);
itemInfo.setValue("存在风险");
ArrayList list = new ArrayList();
//详细指标值
CheckItemInfo.DetailItem item = new CheckItemInfo.DetailItem();
item.setTitle("工控机链接状态");
item.setValue("断开");
list.add(item);
arrSys.add(itemInfo);
//鹰眼测试数据
CheckItemInfo yingyan = new CheckItemInfo();
yingyan.setTitle("鹰眼软件");
yingyan.setUsual(false);
yingyan.setValue("无风险");
CheckItemInfo.DetailItem netItem = new CheckItemInfo.DetailItem();
netItem.setTitle("网络状态");
netItem.setValue(String.valueOf(sNetWorkStatus.getSignalStrength()));
list.add(netItem);
CheckItemInfo.DetailItem batteryItem = new CheckItemInfo.DetailItem();
batteryItem.setTitle("电池状态");
batteryItem.setValue(String.valueOf(battery));
list.add(batteryItem);
CheckItemInfo.DetailItem cpuItem = new CheckItemInfo.DetailItem();
cpuItem.setTitle("CPU占比");
cpuItem.setValue(String.valueOf(cpu));
list.add(cpuItem);
CheckItemInfo.DetailItem memoryItem = new CheckItemInfo.DetailItem();
memoryItem.setTitle("内存占比");
memoryItem.setValue(String.valueOf(memory));
list.add(memoryItem);
yingyan.setItemList(list);
arrSys.add(yingyan);
dataArrayList.add(arrSys);
}
/**
* 网络
*/
public static NetworkStatusUtil.NetWorkStatus netStatus() {
//网络类型
sNetWorkStatus = NetworkStatusUtil.networkState(context);
//网络强度
if (sNetWorkStatus != null && sNetWorkStatus.getStatus() != null && sNetWorkStatus.getStatus() != "UNKNOWN") {
Log.d(TAG, "网络类型:" + sNetWorkStatus.getStatus() + "网络强度:" + sNetWorkStatus.getSignalStrength());
if (sNetWorkStatus.getSignalStrength() <= -90) {
AIAssist.getInstance(context).speakTTSVoice("网络信号差");
}
} else {
Log.d(TAG, "网络未连接");
AIAssist.getInstance(context).speakTTSVoice("网络未连接");
}
return sNetWorkStatus;
}
/**
* **************************************************************************************软件测试
* 自动驾驶侧:
* 1、车控节点
* <p>
* 2、轨迹地图加载节点
* <p>
* 3、轨迹规划节点
* <p>
* 4、定位转化节点
* <p>
* 5、融合节点
* <p>
* 6、yolov5节点包含红绿灯检测
* <p>
* 7、激光雷达渲染节点
* <p>
* 8、摄像头驱动节点
* <p>
* 9、gnss定位驱动节点
* <p>
* 10、中激光驱动节点
* <p>
* 11、左激光解码节点
* <p>
* 12、左激光驱动节点
* <p>
* 13、右激光解码节点
* <p>
* 14、右激光驱动节点
* <p>
* 15、监控节点
* <p>
* 16、通讯交互节点
* <p>
* 17、轨迹录制节点
* <p>
* 18、can车辆控制节点
* <p>
* 数据上报频率 什么数据的上报频率
* <p>
* 时延 工控机->云 工控机->鹰眼 什么数据的时延
*/
public static void software() {
ArrayList arrSoftware = new ArrayList();
CheckItemInfo itemInfo = new CheckItemInfo();
itemInfo.setViewTitle("软件检测:");
itemInfo.setTitle("自动驾驶系统");
itemInfo.setUsual(true);
itemInfo.setValue("无风险");
arrSoftware.add(itemInfo);
CheckItemInfo itemY = new CheckItemInfo();
itemY.setTitle("鹰眼软件");
itemY.setUsual(true);
itemY.setValue("无风险");
arrSoftware.add(itemY);
dataArrayList.add(arrSoftware);
time();
}
/**
* 时延
* 需要产品确认哪些指标? 定位+周边识别?
*/
public static long time() {
final long start = System.nanoTime();
long adasDataTime = TimeUnit.NANOSECONDS.toMillis((System.nanoTime() - start));
Log.i("ADAS数据延时", "接收数据 -> 发出 cost :" + adasDataTime + "ms");
return adasDataTime;
}
/**
* **************************************************************************************硬件测试
* 1、主激光雷达
* <p>
* 2、侧激光雷达-2个
* <p>
* 3、ADAS长焦摄像头-前
* <p>
* 4、ADAS广角摄像头-前
* <p>
* 5、ADAS标准摄像头-前
* <p>
* 6、ADAS广角摄像头-后
* <p>
* 7、RTK设备
* <p>
* 8、OBU设备
* <p>
* 9、路由器
*/
public static void hardware() {
ArrayList arrHardware = new ArrayList();
CheckItemInfo itemInfo = new CheckItemInfo();
itemInfo.setViewTitle("硬件检测:");
itemInfo.setTitle("自动驾驶系统");
itemInfo.setUsual(false);
ArrayList detailItem = new ArrayList();
CheckItemInfo.DetailItem padItem = new CheckItemInfo.DetailItem();
padItem.setTitle("Pad");
padItem.setValue("异常");
detailItem.add(padItem);
CheckItemInfo.DetailItem cameraTop = new CheckItemInfo.DetailItem();
cameraTop.setTitle("摄像头_top");
cameraTop.setValue("正常");
detailItem.add(cameraTop);
CheckItemInfo.DetailItem cameraMiddle = new CheckItemInfo.DetailItem();
cameraMiddle.setTitle("摄像头_Middle");
cameraMiddle.setValue("正常");
detailItem.add(cameraMiddle);
CheckItemInfo.DetailItem cameraBottom = new CheckItemInfo.DetailItem();
cameraBottom.setTitle("摄像头_Bottom");
cameraBottom.setValue("正常");
detailItem.add(cameraBottom);
CheckItemInfo.DetailItem zhuJiGuang = new CheckItemInfo.DetailItem();
zhuJiGuang.setTitle("主机光雷达");
zhuJiGuang.setValue("异常");
detailItem.add(zhuJiGuang);
CheckItemInfo.DetailItem jiGuangLeft = new CheckItemInfo.DetailItem();
jiGuangLeft.setTitle("左侧激光雷达");
jiGuangLeft.setValue("异常");
detailItem.add(jiGuangLeft);
CheckItemInfo.DetailItem jiGuangRight = new CheckItemInfo.DetailItem();
jiGuangRight.setTitle("右侧激光雷达");
jiGuangRight.setValue("正常");
detailItem.add(jiGuangRight);
CheckItemInfo.DetailItem changjiao = new CheckItemInfo.DetailItem();
changjiao.setTitle("ADAS长焦摄像头");
changjiao.setValue("正常");
detailItem.add(changjiao);
CheckItemInfo.DetailItem guangJiaoFront = new CheckItemInfo.DetailItem();
guangJiaoFront.setTitle("ADAS广焦摄像头-前");
guangJiaoFront.setValue("正常");
detailItem.add(guangJiaoFront);
CheckItemInfo.DetailItem custom = new CheckItemInfo.DetailItem();
custom.setTitle("ADAS标准摄像头");
custom.setValue("正常");
detailItem.add(custom);
CheckItemInfo.DetailItem guangJiaoBe = new CheckItemInfo.DetailItem();
guangJiaoBe.setTitle("ADAS广焦摄像头-后");
guangJiaoBe.setValue("正常");
detailItem.add(guangJiaoBe);
CheckItemInfo.DetailItem rtk = new CheckItemInfo.DetailItem();
rtk.setTitle("RTK设备");
rtk.setValue("正常");
detailItem.add(rtk);
CheckItemInfo.DetailItem obu = new CheckItemInfo.DetailItem();
obu.setTitle("OUB设备");
obu.setValue("正常");
detailItem.add(obu);
CheckItemInfo.DetailItem luyou = new CheckItemInfo.DetailItem();
luyou.setTitle("路由器");
luyou.setValue("正常");
detailItem.add(luyou);
itemInfo.setItemList(detailItem);
arrHardware.add(itemInfo);
dataArrayList.add(arrHardware);
}
/**
* 检测指标上报
*/
public void publishCheckDetail() {
// MogoApisHandler.getInstance().getApis().getNetworkApi().create(CheckApiServices.class,
// HostConst.DEVA_HOST).uploadCheckDetail().
}
public static void start(Context context) {
Intent starter = new Intent(context, CheckActivity.class);
context.startActivity(starter);
}
/**
* 指标异常弹框
*/
public static void showDialog(Context context) {
CheckDialog dialog = new CheckDialog(context, true);
dialog.show();
}
@Override
protected void onDestroy() {
super.onDestroy();
dataArrayList.clear();
}
@Override
protected void onPause() {
super.onPause();
}
}

View File

@@ -0,0 +1,241 @@
package com.mogo.module.check.view;
import android.content.Context;
import android.content.Intent;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import com.mogo.module.check.R;
import com.mogo.module.check.model.CheckItemInfo;
import com.mogo.module.common.MogoApisHandler;
import com.tencent.bugly.proguard.A;
import java.util.ArrayList;
/**
* @author liujing
* @description 检测界面单元格
* @since: 7/27/21
*/
public class CheckAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
private static final String TAG = "CheckActivity";
LayoutInflater mLayoutInflater;
ArrayList dataArrayList;
private Context mContext;
public CheckAdapter(@NonNull Context context, @NonNull ArrayList checkArray) {
mContext = context;
mLayoutInflater = LayoutInflater.from(context);
dataArrayList = checkArray;
Log.d(TAG, dataArrayList.toString());
}
@Override
public int getItemViewType(int position) {
if (position == 0) {
return CheckItemInfo.CheckAdapterStyleEnum.ITEM_TYPE_CHECK_TITLE;
} else if (position == 1) {
return CheckItemInfo.CheckAdapterStyleEnum.ITEM_TYPE_CHECK_LIST;
}
return CheckItemInfo.CheckAdapterStyleEnum.ITEM_TYPE_CHECK_IMAGE;
}
@NonNull
@Override
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
if (viewType == CheckItemInfo.CheckAdapterStyleEnum.ITEM_TYPE_CHECK_TITLE) {
View v = mLayoutInflater.inflate(R.layout.check_titel, parent,
false);
CheckTitleViewHolder holder = new CheckTitleViewHolder(v);
return holder;
}
if (viewType == CheckItemInfo.CheckAdapterStyleEnum.ITEM_TYPE_CHECK_IMAGE) {
View v = mLayoutInflater.inflate(R.layout.check_hardware, parent,
false);
CheckImage holder = new CheckImage(v);
return holder;
}
View v = mLayoutInflater.inflate(R.layout.check_list, parent,
false);
CheckListViewHolder holder = new CheckListViewHolder(v);
return holder;
}
/**
* 顶部view列表
*/
class CheckTitleViewHolder extends RecyclerView.ViewHolder {
private ImageView errorImage;
private TextView mTextView;
public CheckTitleViewHolder(@NonNull View itemView) {
super(itemView);
errorImage = itemView.findViewById(R.id.error_tip_image);
mTextView = itemView.findViewById(R.id.error_title);
}
}
/**
* 版本->软件检测
*/
class CheckListViewHolder extends RecyclerView.ViewHolder {
private TextView viewTitle;
private TextView iconAutoTitle;
private TextView autoRiskState;
private TextView iconyingTitle;
private TextView yingRiskState;
public CheckListViewHolder(@NonNull View itemView) {
super(itemView);
viewTitle = itemView.findViewById(R.id.list_item_title);
//自动驾驶
iconAutoTitle = itemView.findViewById(R.id.icon_auto_title);
autoRiskState = itemView.findViewById(R.id.auto_risk_state);
//鹰眼应用
iconyingTitle = itemView.findViewById(R.id.icon_ying_title);
yingRiskState = itemView.findViewById(R.id.ying_risk_state);
itemView.setLongClickable(true);
itemView.setOnLongClickListener(v -> {
Log.d(TAG, "长按显示状态工具栏");
Intent intent = new Intent();
intent.putExtra("oper", 52);
return true;
});
}
}
/**
* 硬件检测
*/
class CheckImage extends RecyclerView.ViewHolder {
private ImageView pad;
private ImageView jiaoJiGuangTop;
private TextView jiaoJiGuangTopText;
private ImageView jiaoJiGuangBottom;
private TextView jiaoJiGuangBottomText;
private ImageView zhuJiGuang;
private ImageView rtk;
private ImageView cameraTop;
private ImageView cameraMiddle;
private ImageView cameraBottom;
private ImageView cameraBehind;
private ImageView luyouqi;
private ImageView obu;
public CheckImage(@NonNull View itemView) {
super(itemView);
pad = itemView.findViewById(R.id.pad);
jiaoJiGuangTop = itemView.findViewById(R.id.jiaoJiGuangTop);
jiaoJiGuangTopText = itemView.findViewById(R.id.jiaoJiGuangTop_txt);
jiaoJiGuangBottom = itemView.findViewById(R.id.jiaoJiGuangBottom);
jiaoJiGuangBottomText = itemView.findViewById(R.id.jiaoJiGuangBottom_txt);
zhuJiGuang = itemView.findViewById(R.id.zhujiguang);
rtk = itemView.findViewById(R.id.rtk);
cameraTop = itemView.findViewById(R.id.top);
cameraMiddle = itemView.findViewById(R.id.middle);
cameraBottom = itemView.findViewById(R.id.bottom);
cameraBehind = itemView.findViewById(R.id.camera_begind);
luyouqi = itemView.findViewById(R.id.luyouqi);
obu = itemView.findViewById(R.id.obu);
}
}
@Override
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
try {
Object list = dataArrayList.get(position);
if (position == 0) {
if (list instanceof ArrayList && ((ArrayList) list).size() > 0) {
CheckItemInfo item = (CheckItemInfo) ((ArrayList) list).get(0);
((CheckTitleViewHolder) holder).mTextView.setText(item.getTitle());
if (item.isUsual() == true) {
((CheckTitleViewHolder) holder).errorImage.setImageResource(R.drawable.check_right);
} else {
((CheckTitleViewHolder) holder).errorImage.setImageResource(R.drawable.check_wrong);
}
}
} else if (position == dataArrayList.size() - 1) {
((CheckListViewHolder) holder).viewTitle.setText("硬件检测:");
if (list instanceof ArrayList) {
refreshHardware(holder, (ArrayList) list);
}
} else {
if (list instanceof ArrayList && ((ArrayList) list).size() > 1) {
CheckItemInfo item = (CheckItemInfo) ((ArrayList) list).get(0);
((CheckListViewHolder) holder).viewTitle.setText(item.getViewTitle());
//自动驾驶 状态展示
((CheckListViewHolder) holder).iconAutoTitle.setText(item.getTitle());
((CheckListViewHolder) holder).autoRiskState.setText(item.getValue());
if (item.isUsual() == true) {
((CheckListViewHolder) holder).autoRiskState.setTextColor(mContext.getResources().getColor(R.color.check_little_btn_green));
} else {
((CheckListViewHolder) holder).autoRiskState.setTextColor(mContext.getResources().getColor(R.color.check_tip_error_color));
}
if (position == 1) {
if (item.isUsual() == false) {
((CheckListViewHolder) holder).autoRiskState.setTextColor(mContext.getResources().getColor(R.color.modules_commons_toast_text_color));
((CheckListViewHolder) holder).autoRiskState.setBackground(mContext.getResources().getDrawable(R.drawable.check_detail));
((CheckListViewHolder) holder).autoRiskState.setOnClickListener(v -> {
Log.d(TAG, "点击自动驾驶升级");
});
} else {
((CheckListViewHolder) holder).autoRiskState.setTextColor(mContext.getResources().getColor(R.color.check_little_btn_green));
}
}
//鹰眼 状态展示
CheckItemInfo itemForYing = (CheckItemInfo) ((ArrayList) list).get(1);
((CheckListViewHolder) holder).iconyingTitle.setText(itemForYing.getTitle());
((CheckListViewHolder) holder).yingRiskState.setText(itemForYing.getValue());
if (itemForYing.isUsual() == true) {
((CheckListViewHolder) holder).yingRiskState.setTextColor(mContext.getResources().getColor(R.color.check_little_btn_green));
} else {
((CheckListViewHolder) holder).yingRiskState.setTextColor(mContext.getResources().getColor(R.color.check_tip_error_color));
}
if (position == 1) {
if (itemForYing.isUsual() == false) {
((CheckListViewHolder) holder).yingRiskState.setTextColor(mContext.getResources().getColor(R.color.modules_commons_toast_text_color));
((CheckListViewHolder) holder).yingRiskState.setBackground(mContext.getResources().getDrawable(R.drawable.check_detail));
((CheckListViewHolder) holder).yingRiskState.setOnClickListener(v -> {
Log.d(TAG, "点击鹰眼升级");
});
} else {
((CheckListViewHolder) holder).yingRiskState.setTextColor(mContext.getResources().getColor(R.color.check_little_btn_green));
}
}
}
}
} catch (Exception e) {
e.printStackTrace();
}
}
/**
* 硬件检测指标
*
* @param list
*/
public void refreshHardware(@NonNull RecyclerView.ViewHolder holder, ArrayList list) {
if (list.size() > 0) {
CheckItemInfo info = (CheckItemInfo) list.get(0);
}
}
@Override
public int getItemCount() {
return dataArrayList.size();
}
}

View File

@@ -0,0 +1,59 @@
package com.mogo.module.check.view;
import android.content.Context;
import android.view.View;
import android.widget.ImageView;
import androidx.annotation.NonNull;
import com.mogo.module.check.R;
import com.mogo.module.common.dialog.BaseFloatDialog;
/**
* @author liujing
* @description 车辆监控弹框提示
* @since: 7/30/21
*/
public class CheckDialog extends BaseFloatDialog {
private ImageView cancel;
private boolean showWarning;
public CheckDialog(@NonNull Context context, boolean hasError) {
super(context);
showWarning = hasError;
initView();
}
public CheckDialog(@NonNull Context context, int themeResId) {
super(context, themeResId);
}
public void initView() {
setContentView(R.layout.check_dialog);
cancel = findViewById(R.id.cancel_button);
cancel.setOnClickListener(v -> {
cancel();
});
//根据条件显示体检页面/风险提示
if (showWarning == true) {
findViewById(R.id.error_view).setVisibility(View.VISIBLE);
findViewById(R.id.check_view).setVisibility(View.INVISIBLE);
} else {
findViewById(R.id.error_view).setVisibility(View.INVISIBLE);
findViewById(R.id.check_view).setVisibility(View.VISIBLE);
}
}
public void cancel() {
super.dismiss();
}
@Override
public void dismiss() {
}
}

View File

@@ -0,0 +1,36 @@
package com.mogo.module.check.view;
import android.content.Context;
import android.util.AttributeSet;
import android.util.Log;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
/**
* @author liujing
* @description 描述
* @since: 7/27/21
*/
class CheckLinearLayout extends LinearLayoutManager {
public CheckLinearLayout(Context context) {
super(context);
}
public CheckLinearLayout(Context context, int orientation, boolean reverseLayout) {
super(context, orientation, reverseLayout);
}
public CheckLinearLayout(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
super(context, attrs, defStyleAttr, defStyleRes);
}
@Override
public void onLayoutChildren(RecyclerView.Recycler recycler, RecyclerView.State state) {
try {
super.onLayoutChildren(recycler, state);
} catch (IndexOutOfBoundsException e) {
Log.d("CheckLinearLayout", "崩溃信息--" + e.toString());
}
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="#bf000000" />
</shape>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="#4192FF"/>
<corners android:radius="55px"/>
</shape>

View File

@@ -1,11 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<corners android:radius="6px" />
<gradient
android:angle="180"
android:endColor="#ff3371f1"
android:startColor="#ff30a8f6"
android:type="linear"
android:useLevel="true" />
</shape>
android:endColor="#2B6EFF"
android:startColor="#3DCCFF" />
</shape>

View File

@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="#2B6EFF"/>
<corners android:radius="55px"/>
</shape>

View File

@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="#1E3282"/>
<corners android:radius="30px"/>
</shape>

View File

@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<corners android:radius="@dimen/dp_30" />
<gradient
android:angle="180"
android:endColor="@color/check_list_item_back"
android:startColor="@color/check_list_item_back"
android:type="linear" />
</shape>

View File

@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<size
android:width="@dimen/check_little_btn_width"
android:height="@dimen/check_little_btn_width" />
//填充
<solid android:color="@color/check_little_btn_solid" />
//描边
<stroke
android:width="2px"
android:color="@color/check_little_btn" />
</shape>

View File

@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<size
android:width="@dimen/check_little_btn_width"
android:height="@dimen/check_little_btn_width" />
//填充
<solid android:color="@color/check_little_btn_solid_green" />
//描边
<stroke
android:width="2px"
android:color="@color/check_little_btn_green" />
</shape>

View File

@@ -0,0 +1,29 @@
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:id="@android:id/background">
<shape>
<corners android:radius="@dimen/dp_33" />
<solid android:color="#0B1030" />
</shape>
</item>
<item android:id="@android:id/progress">
<scale android:scaleWidth="100%">
<shape>
<corners android:radius="@dimen/dp_33" />
<solid android:color="#3DCCFF" />
<gradient
android:angle="180"
android:endColor="#2B6EFF"
android:startColor="#3DCCFF" />
</shape>
</scale>
</item>
<item android:id="@android:id/secondaryProgress">
<scale android:scaleWidth="100%">
<shape>
<corners android:radius="@dimen/dp_33" />
<solid android:color="#0B1030" />
</shape>
</scale>
</item>
</layer-list>

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 362 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 379 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 65 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 347 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

View File

@@ -0,0 +1,105 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/blue_back_color"
tools:context=".view.CheckActivity">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/check_list"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<ImageView
android:id="@+id/btnBack"
android:layout_width="@dimen/dp_106"
android:layout_height="@dimen/dp_106"
android:layout_marginLeft="@dimen/dp_50"
android:layout_marginTop="@dimen/dp_50"
android:src="@drawable/module_common_icon_close"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/animationLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/blue_back_color">
<ImageView
android:id="@+id/scan_car_image"
android:layout_width="@dimen/check_scan_width"
android:layout_height="@dimen/check_scan_height"
android:layout_marginTop="@dimen/dp_400"
android:src="@drawable/check_scan_first"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<com.mogo.module.common.view.ImageViewClipBounds
android:id="@+id/scan_car_top_image"
android:layout_width="@dimen/check_scan_width"
android:layout_height="@dimen/check_scan_height"
android:scaleType="fitXY"
android:src="@drawable/check_scan_second"
android:visibility="invisible"
app:layout_constraintLeft_toLeftOf="@id/scan_car_image"
app:layout_constraintTop_toTopOf="@id/scan_car_image" />
<com.mogo.module.common.view.ImageViewClipBounds
android:id="@+id/scan_car_tips"
android:layout_width="@dimen/check_scan_width"
android:layout_height="@dimen/check_scan_height"
android:layout_marginLeft="@dimen/dp_699"
android:layout_marginTop="@dimen/dp_400"
android:layout_marginRight="@dimen/dp_699"
android:scaleType="fitEnd"
android:src="@drawable/check_scan_tips"
android:visibility="invisible"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/check_progress_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_120"
android:text="自动驾驶车辆体检中,请稍候……"
android:textColor="@color/module_commons_wm_dialog_text_textColor"
android:textSize="@dimen/dp_42"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@id/scan_car_image" />
<ProgressBar
android:id="@+id/check_progress"
style="@style/check_progressBar_scale"
android:layout_width="@dimen/dp_520"
android:layout_height="@dimen/dp_12"
android:layout_marginTop="@dimen/dp_57"
android:max="100"
android:progress="0"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@id/check_progress_text" />
<ImageView
android:id="@+id/scan_line_image"
android:layout_width="@dimen/dp_25"
android:layout_height="@dimen/dp_652"
android:layout_marginTop="@dimen/dp_370"
android:src="@drawable/scan_tip_line"
app:layout_constraintLeft_toLeftOf="@id/scan_car_image"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -0,0 +1,115 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="1529px"
android:layout_height="720px"
android:layout_gravity="center"
android:background="@drawable/check_dialog_back">
<ImageView
android:id="@+id/cancel_button"
android:layout_width="@dimen/dp_106"
android:layout_height="@dimen/dp_106"
android:layout_marginLeft="@dimen/dp_30"
android:layout_marginTop="@dimen/dp_30"
android:src="@drawable/module_common_icon_close"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<ImageView
android:id="@+id/imageView"
android:layout_width="@dimen/dp_795"
android:layout_height="@dimen/dp_484"
android:layout_marginEnd="@dimen/dp_50"
android:layout_marginBottom="@dimen/dp_78"
android:src="@drawable/check_tip_image"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent" />
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/error_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/dp_97"
android:layout_marginTop="@dimen/dp_225"
android:visibility="invisible"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<ImageView
android:id="@+id/error_image"
android:layout_width="@dimen/dp_56"
android:layout_height="@dimen/dp_56"
android:layout_marginTop="@dimen/dp_15"
android:src="@drawable/check_wrong"
app:layout_constraintTop_toTopOf="@id/error_view" />
<TextView
android:id="@+id/error_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/dp_15"
android:text="自动驾驶车辆存在风险"
android:textColor="@color/module_commons_wm_dialog_text_textColor"
android:textSize="@dimen/dp_54"
android:textStyle="bold"
app:layout_constraintStart_toEndOf="@id/error_image"
app:layout_constraintTop_toTopOf="@id/error_view" />
<TextView
android:id="@+id/error_txt"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_23"
android:text="软件运行异常"
android:textColor="@color/check_tip_error_color"
android:textSize="@dimen/dp_38"
app:layout_constraintTop_toBottomOf="@id/error_title" />
<TextView
android:id="@+id/check_detail"
android:layout_width="@dimen/dp_287"
android:layout_height="@dimen/dp_100"
android:layout_marginTop="@dimen/check_button_bottom"
android:background="@drawable/check_detail"
android:gravity="center"
android:text="查看详情"
android:textColor="@color/module_commons_wm_dialog_text_textColor"
android:textSize="@dimen/check_button_text_size"
app:layout_constraintTop_toBottomOf="@id/error_txt" />
</androidx.constraintlayout.widget.ConstraintLayout>
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/check_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/dp_133"
android:layout_marginTop="@dimen/dp_200"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<TextView
android:id="@+id/check_text_view"
android:layout_width="@dimen/dp_520"
android:layout_height="wrap_content"
android:text="您的自动驾驶系统已经很久没有进行体检了,建议立即体检。"
android:textColor="@color/module_commons_wm_dialog_text_textColor"
android:textSize="@dimen/dp_44" />
<TextView
android:id="@+id/check_button"
android:layout_width="@dimen/dp_287"
android:layout_height="@dimen/dp_100"
android:layout_marginTop="@dimen/check_button_bottom"
android:background="@drawable/check_button"
android:gravity="center"
android:text="立即体检"
android:textColor="@color/module_commons_wm_dialog_text_textColor"
android:textSize="@dimen/check_button_text_size"
app:layout_constraintTop_toBottomOf="@id/check_text_view" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -0,0 +1,314 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginStart="@dimen/dp_100"
android:layout_marginTop="@dimen/dp_15"
android:layout_marginEnd="@dimen/dp_100"
android:layout_marginBottom="@dimen/dp_15"
android:background="@drawable/check_list_item_back">
<TextView
android:id="@+id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/dp_50"
android:layout_marginTop="@dimen/dp_50"
android:gravity="left"
android:text="硬件检测:"
android:textColor="@color/module_commons_wm_dialog_text_textColor"
android:textSize="@dimen/dp_42"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_goneMarginTop="@dimen/dp_50" />
<TextView
android:id="@+id/description"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_50"
android:text="(下面 1 项存在异常)"
android:textColor="@color/module_commons_wm_dialog_text_textColor"
android:textSize="@dimen/dp_42"
app:layout_constraintLeft_toRightOf="@+id/title"
app:layout_constraintTop_toTopOf="parent" />
<!--角激光文字-->
<TextView
android:id="@+id/jiaoJiGuangTop_txt"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="@+id/check_image"
android:layout_marginStart="@dimen/dp_1000"
android:layout_marginTop="@dimen/dp_236"
android:gravity="center"
android:text="角激光"
android:textColor="@color/module_commons_wm_dialog_text_textColor"
android:textSize="@dimen/dp_32"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<!--车辆模型-->
<RelativeLayout
android:id="@+id/check_image"
android:layout_width="@dimen/check_hard_ware_image_width"
android:layout_height="@dimen/check_hard_ware_image_height"
android:layout_marginLeft="@dimen/dp_460"
android:layout_marginTop="144dp"
android:background="@drawable/check_scan_first"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent">
<!--Pad-->
<ImageView
android:id="@+id/pad"
android:layout_width="@dimen/dp_95"
android:layout_height="@dimen/dp_145"
android:layout_centerVertical="true"
android:layout_marginStart="@dimen/dp_292"
android:src="@drawable/pad_unusual" />
<TextView
android:id="@+id/pad_txt"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignStart="@+id/pad"
android:layout_alignEnd="@+id/pad"
android:layout_centerVertical="true"
android:gravity="center"
android:text="Pad"
android:textColor="@color/module_commons_wm_dialog_text_textColor"
android:textSize="@dimen/dp_32" />
<!--前摄像头3-->
<TextView
android:id="@+id/camera_front_txt"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="@+id/camera"
android:layout_marginStart="@dimen/dp_434"
android:layout_marginBottom="@dimen/dp_42"
android:gravity="center"
android:text="摄像头"
android:textColor="@color/module_commons_wm_dialog_text_textColor"
android:textSize="@dimen/dp_32" />
<LinearLayout
android:id="@+id/camera"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginStart="@dimen/dp_65"
android:layout_toEndOf="@+id/pad"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:id="@+id/top"
android:layout_width="@dimen/dp_56"
android:layout_height="@dimen/dp_56"
android:src="@drawable/camera_usual" />
<ImageView
android:id="@+id/middle"
android:layout_width="@dimen/dp_56"
android:layout_height="@dimen/dp_56"
android:layout_marginTop="@dimen/dp_10"
android:src="@drawable/camera_usual" />
<ImageView
android:id="@+id/bottom"
android:layout_width="@dimen/dp_56"
android:layout_height="@dimen/dp_56"
android:layout_marginTop="@dimen/dp_10"
android:src="@drawable/camera_usual" />
</LinearLayout>
<!--角激光-->
<ImageView
android:id="@+id/jiaoJiGuangTop"
android:layout_width="@dimen/dp_70"
android:layout_height="@dimen/dp_70"
android:layout_marginLeft="@dimen/dp_57"
android:layout_marginTop="@dimen/dp_100"
android:layout_toEndOf="@+id/camera"
android:src="@drawable/zhujiguang_usual" />
<ImageView
android:id="@+id/jiaoJiGuangBottom"
android:layout_width="@dimen/dp_70"
android:layout_height="@dimen/dp_70"
android:layout_alignTop="@+id/jiaoJiGuangTop"
android:layout_marginLeft="@dimen/dp_57"
android:layout_marginTop="@dimen/dp_440"
android:layout_toEndOf="@+id/camera"
android:src="@drawable/zhujiguang_usual" />
<!--主激光-->
<ImageView
android:id="@+id/zhujiguang"
android:layout_width="@dimen/dp_140"
android:layout_height="@dimen/dp_140"
android:layout_centerVertical="true"
android:layout_marginLeft="@dimen/dp_77"
android:layout_toEndOf="@+id/camera"
android:src="@drawable/zhujiguang_usual" />
<TextView
android:id="@+id/zhujiguang_txt"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignStart="@+id/zhujiguang"
android:layout_alignEnd="@+id/zhujiguang"
android:layout_centerVertical="true"
android:gravity="center"
android:text="主激光"
android:textColor="@color/module_commons_wm_dialog_text_textColor"
android:textSize="@dimen/dp_32" />
<!--RTK-->
<ImageView
android:id="@+id/rtk"
android:layout_width="@dimen/dp_140"
android:layout_height="@dimen/dp_80"
android:layout_centerVertical="true"
android:layout_marginLeft="@dimen/dp_48"
android:layout_toEndOf="@+id/zhujiguang"
android:src="@drawable/rtk_usual" />
<TextView
android:id="@+id/rtk_txt"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignStart="@+id/rtk"
android:layout_alignEnd="@+id/rtk"
android:layout_centerVertical="true"
android:gravity="center"
android:text="RTK"
android:textColor="@color/module_commons_wm_dialog_text_textColor"
android:textSize="@dimen/dp_32" />
<!--摄像头-后1-->
<ImageView
android:id="@+id/camera_begind"
android:layout_width="@dimen/dp_56"
android:layout_height="@dimen/dp_56"
android:layout_centerVertical="true"
android:layout_marginStart="@dimen/dp_78"
android:layout_toEndOf="@+id/rtk"
android:src="@drawable/camera_usual" />
<TextView
android:id="@+id/camera_begind_txt"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="@+id/camera_begind"
android:layout_marginStart="@dimen/dp_972"
android:layout_marginBottom="@dimen/dp_42"
android:gravity="center"
android:text="摄像头"
android:textColor="@color/module_commons_wm_dialog_text_textColor"
android:textSize="@dimen/dp_32" />
<!--路由器-->
<ImageView
android:id="@+id/luyouqi"
android:layout_width="@dimen/dp_77"
android:layout_height="@dimen/dp_90"
android:layout_centerVertical="true"
android:layout_marginStart="@dimen/dp_38"
android:layout_toEndOf="@+id/camera_begind"
android:src="@drawable/luyouqi_usual" />
<TextView
android:id="@+id/luyouqi_txt"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/luyouqi"
android:layout_marginStart="@dimen/check_luyouqi_start"
android:layout_marginTop="@dimen/dp_42"
android:gravity="center"
android:text="路由器"
android:textColor="@color/module_commons_wm_dialog_text_textColor"
android:textSize="@dimen/dp_32" />
<!--OBU-->
<ImageView
android:id="@+id/obu"
android:layout_width="@dimen/dp_140"
android:layout_height="@dimen/dp_80"
android:layout_alignParentTop="true"
android:layout_centerVertical="true"
android:layout_marginStart="@dimen/dp_15"
android:layout_marginTop="@dimen/dp_140"
android:layout_toEndOf="@+id/luyouqi"
android:src="@drawable/obu_unusual" />
</RelativeLayout>
<!--角激光文字-->
<TextView
android:id="@+id/jiaoJiGuangBottom_txt"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/check_image"
android:layout_marginStart="@dimen/dp_1000"
android:gravity="center"
android:text="角激光"
android:textColor="@color/module_commons_wm_dialog_text_textColor"
android:textSize="@dimen/dp_32"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toBottomOf="@+id/check_image" />
<!--OBU文案-->
<TextView
android:id="@+id/obu_top_txt"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="@+id/check_image"
android:layout_marginStart="@dimen/check_obu_start"
android:layout_marginTop="@dimen/dp_236"
android:gravity="center"
android:text="OBU"
android:textColor="@color/module_commons_wm_dialog_text_textColor"
android:textSize="@dimen/dp_32"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<ImageView
android:id="@+id/error_tip"
android:layout_width="@dimen/dp_32"
android:layout_height="@dimen/dp_32"
android:layout_marginLeft="@dimen/dp_907"
android:layout_marginTop="@dimen/dp_177"
android:background="@drawable/check_little_btn"
android:backgroundTint="@color/check_tip_error_color"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toBottomOf="@+id/check_image" />
<TextView
android:id="@+id/unusual_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_24"
android:text="设备故障"
android:textColor="@color/module_commons_wm_dialog_text_textColor"
app:layout_constraintLeft_toRightOf="@+id/error_tip"
app:layout_constraintTop_toTopOf="@+id/error_tip" />
<ImageView
android:id="@+id/error_tip_green"
android:layout_width="@dimen/dp_32"
android:layout_height="@dimen/dp_32"
android:layout_marginLeft="@dimen/dp_160"
android:layout_marginTop="88dp"
android:background="@drawable/check_little_btn_green"
app:layout_constraintLeft_toRightOf="@id/unusual_title"
app:layout_constraintTop_toBottomOf="@+id/check_image" />
<TextView
android:id="@+id/usual_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_24"
android:text="设备正常"
android:textColor="@color/module_commons_wm_dialog_text_textColor"
app:layout_constraintLeft_toRightOf="@+id/error_tip_green"
app:layout_constraintTop_toTopOf="@+id/error_tip_green" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -0,0 +1,114 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="2360px"
android:layout_height="@dimen/dp_643"
android:layout_marginStart="@dimen/dp_100"
android:layout_marginTop="@dimen/dp_15"
android:layout_marginEnd="@dimen/dp_100"
android:layout_marginBottom="@dimen/dp_15"
android:background="@drawable/check_list_item_back">
<TextView
android:id="@+id/list_item_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/dp_80"
android:layout_marginLeft="@dimen/dp_50"
android:layout_marginTop="@dimen/dp_50"
android:text="版本检测:(以下 1 项需要优化,版本升级后需要重启设备)"
android:textColor="@color/module_commons_wm_dialog_text_textColor"
android:textSize="@dimen/dp_42"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<!--自动驾驶应用-->
<LinearLayout
android:id="@+id/auto_layout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_318"
android:layout_marginTop="@dimen/dp_78"
android:layout_marginBottom="@dimen/dp_108"
android:orientation="vertical"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toBottomOf="@+id/title">
<ImageView
android:id="@+id/icon_auto"
android:layout_width="@dimen/dp_150"
android:layout_height="@dimen/dp_150"
android:layout_gravity="center"
android:src="@drawable/auto" />
<TextView
android:id="@+id/icon_auto_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="@dimen/dp_22"
android:maxLines="2"
android:text="自动驾驶升级到\n 版本"
android:textColor="@color/module_commons_wm_dialog_text_textColor"
android:textSize="@dimen/dp_42"
app:layout_constraintTop_toBottomOf="@id/icon_auto" />
<TextView
android:id="@+id/auto_risk_state"
android:layout_width="@dimen/dp_260"
android:layout_height="@dimen/dp_90"
android:layout_gravity="center"
android:layout_marginTop="@dimen/dp_56"
android:gravity="center"
android:textColor="@color/check_little_btn_green"
android:textSize="@dimen/dp_36"
app:layout_constraintTop_toTopOf="@+id/icon_auto_title" />
</LinearLayout>
<LinearLayout
android:id="@+id/ying_layout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_318"
android:layout_marginTop="@dimen/dp_78"
android:layout_marginBottom="@dimen/dp_108"
android:orientation="vertical"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toRightOf="@+id/auto_layout"
app:layout_constraintTop_toBottomOf="@+id/title">
<ImageView
android:id="@+id/icon_ying"
android:layout_width="@dimen/dp_150"
android:layout_height="@dimen/dp_150"
android:layout_gravity="center"
android:src="@drawable/yingyan" />
<TextView
android:id="@+id/icon_ying_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="@dimen/dp_22"
android:text=" 鹰眼\n版本"
android:textAlignment="center"
android:textColor="@color/module_commons_wm_dialog_text_textColor"
android:textSize="@dimen/dp_42"
app:layout_constraintTop_toBottomOf="@id/icon_auto" />
<TextView
android:id="@+id/ying_risk_state"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="@dimen/dp_56"
android:textColor="@color/check_little_btn_green"
android:textSize="@dimen/dp_36"
app:layout_constraintTop_toTopOf="@+id/icon_auto_title" />
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -0,0 +1,31 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="@dimen/dp_500"
android:layout_marginStart="@dimen/dp_100"
android:layout_marginTop="@dimen/dp_15"
android:layout_marginEnd="@dimen/dp_100"
android:layout_marginBottom="@dimen/dp_15">
<ImageView
android:id="@+id/error_tip_image"
android:layout_width="@dimen/dp_140"
android:layout_height="@dimen/dp_140"
android:layout_marginStart="@dimen/dp_856"
android:layout_marginTop="@dimen/dp_200"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/error_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_65"
android:layout_marginTop="@dimen/dp_20"
android:text="自动驾驶车辆存在风险"
android:textColor="@color/module_commons_wm_dialog_text_textColor"
android:textSize="@dimen/dp_64"
app:layout_constraintLeft_toRightOf="@+id/error_tip_image"
app:layout_constraintTop_toTopOf="@+id/error_tip_image" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<dimen name="check_item_space_vr">30px</dimen>
<dimen name="check_button_text_size">38px</dimen>
<dimen name="check_button_bottom">70px</dimen>
<dimen name="check_button_left">133px</dimen>
<dimen name="check_image_bottom">50px</dimen>
<dimen name="check_image_right">50px</dimen>
<dimen name="check_hard_ware_image_width">1452px</dimen>
<dimen name="check_hard_ware_image_height">715px</dimen>
<dimen name="check_little_btn_width">32px</dimen>
<dimen name="check_luyouqi_start">1078px</dimen>
<dimen name="check_obu_start">1660px</dimen>
<dimen name="check_scan_width">1162px</dimen>
<dimen name="check_scan_height">570px</dimen>
</resources>

View File

@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="blue_back_color">#1A1F40</color>
<color name="blue_check_color">#4192FF</color>
<color name="check_tip_error_color">#F03232</color>
<color name="check_little_btn_solid">#99FA1F21</color>
<color name="check_little_btn">#FF1F1F</color>
<color name="check_little_btn_solid_green">#997AFF87</color>
<color name="check_little_btn_green">#7AFF87</color>
<color name="check_list_item_back">#242B59</color>
</resources>

View File

@@ -0,0 +1 @@
<resources></resources>

View File

@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="check_progressBar_scale" parent="@android:style/Widget.ProgressBar.Horizontal">
<item name="android:indeterminateDrawable">
@android:drawable/progress_indeterminate_horizontal
</item>
<item name="android:progressDrawable">@drawable/check_progress</item>
</style>
</resources>

View File

@@ -79,14 +79,17 @@ class AdasRecognizedResultDrawer extends BaseDrawer {
* @param resultList adas感知融合数据
*/
public void renderAdasRecognizedResult(List<ADASRecognizedResult> resultList) {
final long start = System.nanoTime();
if (resultList == null || resultList.isEmpty() || !DebugConfig.isUseAdasRecognize()) {
clearOldMarker();
Log.w("ADAS数据延时绘制", "resultList==>" + resultList + " DebugConfig.isUseAdasRecognize()==>" + DebugConfig.isUseAdasRecognize());
return;
}
if (!MogoApisHandler.getInstance().getApis().getStatusManagerApi().isVrMode()) {
clearOldMarker();
Log.w("ADAS数据延时绘制", "当前不是VR模式");
return;
}

View File

@@ -9,10 +9,8 @@ import com.mogo.map.marker.IMogoMarker;
import com.mogo.map.marker.IMogoMarkerClickListener;
import com.mogo.map.marker.MogoMarkerOptions;
import com.mogo.module.common.MogoApisHandler;
import com.mogo.module.common.R;
import com.mogo.module.common.drawer.marker.EmptyMarkerView;
import com.mogo.module.common.drawer.marker.IMarkerView;
import com.mogo.module.common.drawer.marker.MapMarker3DResAdapter;
import com.mogo.module.common.drawer.marker.MapMarkerAdapter;
import com.mogo.module.common.drawer.marker.OnlineCarMarkerView;
import com.mogo.module.common.entity.MarkerExploreWay;
@@ -20,6 +18,7 @@ import com.mogo.module.common.entity.MarkerNoveltyInfo;
import com.mogo.module.common.entity.MarkerOnlineCar;
import com.mogo.module.common.entity.MarkerShareMusic;
import com.mogo.module.common.entity.MarkerShowEntity;
import com.mogo.module.common.enums.EventTypeEnum;
import com.mogo.utils.logger.Logger;
import java.util.HashMap;
@@ -91,7 +90,7 @@ class MarkerDrawer {
Object bindObj = markerShowEntity.getBindObj();
if (bindObj instanceof MarkerExploreWay && ((MarkerExploreWay) bindObj).getPoiType() != null) {
String poiType = ((MarkerExploreWay) bindObj).getPoiType();
options.icon3DRes(MapMarker3DResAdapter.getMarker3DRes(poiType));
options.icon3DRes(EventTypeEnum.getMarker3DRes(poiType));
}
}

View File

@@ -1,55 +0,0 @@
package com.mogo.module.common.drawer.marker;
import android.content.Context;
import com.mogo.map.marker.MogoMarkerOptions;
import com.mogo.module.common.R;
import com.mogo.module.common.entity.MarkerShowEntity;
import static com.mogo.module.common.entity.MarkerPoiTypeEnum.FOURS_ACCIDENT;
import static com.mogo.module.common.entity.MarkerPoiTypeEnum.FOURS_BLOCK_UP;
import static com.mogo.module.common.entity.MarkerPoiTypeEnum.FOURS_FOG;
import static com.mogo.module.common.entity.MarkerPoiTypeEnum.FOURS_ICE;
import static com.mogo.module.common.entity.MarkerPoiTypeEnum.FOURS_LIVING;
import static com.mogo.module.common.entity.MarkerPoiTypeEnum.FOURS_PONDING;
import static com.mogo.module.common.entity.MarkerPoiTypeEnum.FOURS_ROAD_WORK;
import static com.mogo.module.common.entity.MarkerPoiTypeEnum.TRAFFIC_CHECK;
/**
* created by wujifei on 2021/4/28 18:04
* describe:地图Marker的3d资源适配器
*/
public class MapMarker3DResAdapter {
public static int getMarker3DRes(String poiType) {
int res = 0;
switch (poiType) {
case FOURS_BLOCK_UP:
res = R.raw.v2x_yongdu;
break;
case FOURS_ACCIDENT:
res = R.raw.v2x_shigu;
break;
case FOURS_LIVING:
res = R.raw.v2x_shishilukuang;
break;
case FOURS_FOG:
res = R.raw.v2x_nongwu;
break;
case TRAFFIC_CHECK:
res = R.raw.v2x_jiaotongjiancha;
break;
case FOURS_ROAD_WORK:
res = R.raw.v2x_daolushigong;
break;
case FOURS_ICE:
res = R.raw.v2x_daolujiebing;
break;
case FOURS_PONDING:
res = R.raw.v2x_daolujishui;
break;
}
return res;
}
}

View File

@@ -3,6 +3,8 @@ package com.mogo.module.common.entity;
import android.text.TextUtils;
import com.mogo.module.common.enums.EventTypeEnum;
import java.io.Serializable;
import java.util.List;
import java.util.Objects;
@@ -13,7 +15,7 @@ public class MarkerExploreWay implements Serializable {
private String infoId;
private String type;//卡片类型,
/**
* @see MarkerPoiTypeEnum
* @see EventTypeEnum
*/
private String poiType;
private String sn;
@@ -154,7 +156,7 @@ public class MarkerExploreWay implements Serializable {
public String getPoiType() {
if (TextUtils.isEmpty(poiType)) {
return MarkerPoiTypeEnum.FOURS_BLOCK_UP;
return EventTypeEnum.FOURS_BLOCK_UP.getPoiType();
}
return poiType;
}

View File

@@ -9,7 +9,7 @@ public class MarkerNoveltyInfo {
private String sn;
private MarkerLocation location;
/**
* @see MarkerPoiTypeEnum
* @see com.mogo.module.common.enums.EventTypeEnum
*/
private String poiType;
private ContentData contentData;

View File

@@ -1,55 +0,0 @@
package com.mogo.module.common.entity;
/**
* author : donghongyu
* e-mail : 1358506549@qq.com
* date : 2020-01-1514:47
* desc : 车机启动状态
* version: 1.0
*/
public interface MarkerPoiTypeEnum {
//加油站
String GAS_STATION = "10001";
//交通检查
String TRAFFIC_CHECK = "10002";
//封路
String ROAD_CLOSED = "10003";
//商场打折
String SHOP_DISCOUNT = "10004";
//4S店
String FOURS_4S = "10005";
//施工
String FOURS_ROAD_WORK = "10006";
//拥堵
String FOURS_BLOCK_UP = "10007";
//积水
String FOURS_PONDING = "10008";
//超市打折
String FOURS_SHOP_FREE = "10009";
//浓雾
String FOURS_FOG = "10010";
//结冰
String FOURS_ICE = "10011";
//停车场
String FOURS_PARKING = "10012";
//事故
String FOURS_ACCIDENT = "10013";
//重大事故
String FOURS_ACCIDENT_01 = "1001301";
//特大事故
String FOURS_ACCIDENT_02 = "1001302";
//较大事故
String FOURS_ACCIDENT_03 = "1001303";
//一般事故
String FOURS_ACCIDENT_04 = "1001304";
//轻微事故
String FOURS_ACCIDENT_05 = "1001305";
//身边
String FOURS_NEALY = "10014";
//实时路况
String FOURS_LIVING = "10015";
//违章停车
String ILLEGAL_PARK_LIVING = "10016";
//路面湿滑
String ROAD_SLIPPERY = "10021";
}

View File

@@ -1,31 +0,0 @@
package com.mogo.module.common.entity;
/**
* author : donghongyu
* e-mail : 1358506549@qq.com
* date : 2020/3/31 4:53 PM
* desc : V2X 道路事件类型
* version: 1.0
*/
public interface V2XPoiTypeEnum extends MarkerPoiTypeEnum {
// 前方静止or慢速车辆报警
String ALERT_FRONT_CAR = "99999";
// 限行管理
String ALERT_TRAFFIC_CONTROL = "99998";
// 红绿灯事件、是建议以多少速度驶过
String ALERT_TRAFFIC_LIGHT_SUGGEST = "99997";
// 红绿灯事件、一种是绿灯不足3秒
String ALERT_TRAFFIC_LIGHT_WARNING = "99996";
// 故障车辆
int ALERT_CAR_TROUBLE_WARNING = 20007;
// 疲劳驾驶
String ALERT_FATIGUE_DRIVING = "99993";
// 违章停车
String ALERT_ILLEGAL_PARK = "99992";
// TODO 这里目前是演示DEMO会用到想着是打算商用先这么处理的
// 取快递
String ALERT_TRAFFIC_EXPRESS = "99995";
// 顺风车
String ALERT_TRAFFIC_TAXI = "99994";
}

View File

@@ -2,6 +2,8 @@ package com.mogo.module.common.entity;
import android.text.TextUtils;
import com.mogo.module.common.enums.EventTypeEnum;
import java.io.Serializable;
import java.util.Objects;
@@ -14,7 +16,7 @@ import java.util.Objects;
*/
public class V2XRoadEventEntity implements Serializable {
/**
* @see MarkerPoiTypeEnum
* @see EventTypeEnum
*/
// 事件类型
private String poiType;
@@ -57,56 +59,7 @@ public class V2XRoadEventEntity implements Serializable {
public String getTts(boolean haveLiveCar) {
tts = "前方#" + (int) getDistance() + "米#";
switch (getPoiType()) {
// 停车场
case V2XPoiTypeEnum.FOURS_PARKING:
tts += "停车场";
break;
// 加油站
case V2XPoiTypeEnum.GAS_STATION:
tts += "加油站";
break;
// 交通检查
case V2XPoiTypeEnum.TRAFFIC_CHECK:
tts += "交通检查";
break;
// 封路
case V2XPoiTypeEnum.ROAD_CLOSED:
tts += "道路封路";
break;
// 施工
case V2XPoiTypeEnum.FOURS_ROAD_WORK:
tts += "道路施工";
break;
// 拥堵
case V2XPoiTypeEnum.FOURS_BLOCK_UP:
tts += "道路拥堵";
break;
// 积水
case V2XPoiTypeEnum.FOURS_PONDING:
tts += "道路积水";
break;
// 浓雾
case V2XPoiTypeEnum.FOURS_FOG:
tts += "出现浓雾";
break;
// 结冰
case V2XPoiTypeEnum.FOURS_ICE:
tts += "路面结冰";
break;
// 事故
case V2XPoiTypeEnum.FOURS_ACCIDENT:
case V2XPoiTypeEnum.FOURS_ACCIDENT_01: // 重大事故
case V2XPoiTypeEnum.FOURS_ACCIDENT_02: // 特大事故
case V2XPoiTypeEnum.FOURS_ACCIDENT_03: // 较大事故
case V2XPoiTypeEnum.FOURS_ACCIDENT_04: // 一般事故
case V2XPoiTypeEnum.FOURS_ACCIDENT_05: // 轻微事故
tts += "交通事故";
break;
default:
tts += "道路事件";
break;
}
tts += EventTypeEnum.getTts(getPoiType());
if (haveLiveCar) {
tts += ",查看实况请说确定。";
setShowEventButton(true);
@@ -122,56 +75,7 @@ public class V2XRoadEventEntity implements Serializable {
*/
public String getTtsWithFeedback() {
tts = "检测到附近";
switch (getPoiType()) {
// 停车场
case V2XPoiTypeEnum.FOURS_PARKING:
tts += "有停车场";
break;
// 加油站
case V2XPoiTypeEnum.GAS_STATION:
tts += "有加油站";
break;
// 交通检查
case V2XPoiTypeEnum.TRAFFIC_CHECK:
tts += "交通检查";
break;
// 封路
case V2XPoiTypeEnum.ROAD_CLOSED:
tts += "封路";
break;
// 施工
case V2XPoiTypeEnum.FOURS_ROAD_WORK:
tts += "施工";
break;
// 拥堵
case V2XPoiTypeEnum.FOURS_BLOCK_UP:
tts += "道路拥堵";
break;
// 积水
case V2XPoiTypeEnum.FOURS_PONDING:
tts += "道路积水";
break;
// 浓雾
case V2XPoiTypeEnum.FOURS_FOG:
tts += "出现浓雾";
break;
// 结冰
case V2XPoiTypeEnum.FOURS_ICE:
tts += "路面结冰";
break;
// 事故
case V2XPoiTypeEnum.FOURS_ACCIDENT:
case V2XPoiTypeEnum.FOURS_ACCIDENT_01: // 重大事故
case V2XPoiTypeEnum.FOURS_ACCIDENT_02: // 特大事故
case V2XPoiTypeEnum.FOURS_ACCIDENT_03: // 较大事故
case V2XPoiTypeEnum.FOURS_ACCIDENT_04: // 一般事故
case V2XPoiTypeEnum.FOURS_ACCIDENT_05: // 轻微事故
tts += "交通事故";
break;
default:
tts += "道路事件";
break;
}
tts += EventTypeEnum.getTtsWithFeedback(getPoiType());
tts += ",确认该信息是否正确?您可以说“正确”或“错误”帮助其他车友。";
return tts;
}
@@ -193,56 +97,7 @@ public class V2XRoadEventEntity implements Serializable {
}
public String getAlarmContent() {
switch (getPoiType()) {
// 停车场
case V2XPoiTypeEnum.FOURS_PARKING:
alarmContent = "停车场附近";
break;
// 加油站
case V2XPoiTypeEnum.GAS_STATION:
alarmContent = "加油站附近";
break;
// 交通检查
case V2XPoiTypeEnum.TRAFFIC_CHECK:
alarmContent = "前方交通检查";
break;
// 封路
case V2XPoiTypeEnum.ROAD_CLOSED:
alarmContent = "前方封路";
break;
// 施工
case V2XPoiTypeEnum.FOURS_ROAD_WORK:
alarmContent = "前方施工";
break;
// 拥堵
case V2XPoiTypeEnum.FOURS_BLOCK_UP:
alarmContent = "前方道路拥堵";
break;
// 积水
case V2XPoiTypeEnum.FOURS_PONDING:
alarmContent = "前方道路积水";
break;
// 浓雾
case V2XPoiTypeEnum.FOURS_FOG:
alarmContent = "前方出现浓雾";
break;
// 结冰
case V2XPoiTypeEnum.FOURS_ICE:
alarmContent = "前方路面结冰";
break;
// 事故
case V2XPoiTypeEnum.FOURS_ACCIDENT:
case V2XPoiTypeEnum.FOURS_ACCIDENT_01: // 重大事故
case V2XPoiTypeEnum.FOURS_ACCIDENT_02: // 特大事故
case V2XPoiTypeEnum.FOURS_ACCIDENT_03: // 较大事故
case V2XPoiTypeEnum.FOURS_ACCIDENT_04: // 一般事故
case V2XPoiTypeEnum.FOURS_ACCIDENT_05: // 轻微事故
alarmContent = "前方交通事故";
break;
default:
tts += "道路事件";
break;
}
alarmContent = EventTypeEnum.getAlarmContent(getPoiType());
return alarmContent;
}

View File

@@ -0,0 +1,852 @@
package com.mogo.module.common.enums
import com.mogo.module.common.R
import com.mogo.module.common.utils.CloudPoiManager
import com.mogo.module.common.utils.Const.*
import com.zhidao.support.obu.constants.ObuConstants
/**
* OBU、V2N事件类型枚举类
*/
enum class EventTypeEnum(
val poiType: String, val poiTypeStr: String = "",
val poiTypeStrVr: String = "",
val poiTypeSrcVr: Int = R.drawable.v2x_icon_live_logo,
val content: String = "", val tts: String = ""
) {
//加油站
GAS_STATION("10001", "加油站", content = "加油站附近", tts = "加油站"),
//交通检查
TRAFFIC_CHECK("10002", "交通检查", "前方交通检查",
R.drawable.v2x_icon_jiaotongjiancha_vr, "前方交通检查", "交通检查"),
//封路
ROAD_CLOSED("10003", "封路", "前方封路", R.drawable.v2x_icon_fenglu_vr,
"前方封路", "道路封路"),
//商场打折
SHOP_DISCOUNT("10004", ""),
//4S店
FOURS_4S("10005", ""),
//施工
FOURS_ROAD_WORK("10006", "道路施工", "前方施工", R.drawable.v2x_icon_daolushigong_vr,
"前方施工", "道路施工"),
//拥堵
FOURS_BLOCK_UP("10007", "道路拥堵", "前方拥堵", R.drawable.v2x_icon_yongdu_vr,
"前方道路拥堵", "道路拥堵"),
//积水
FOURS_PONDING("10008", "道路积水", "前方道路积水", R.drawable.v2x_icon_jishui_vr,
"前方道路积水", "道路积水"),
//超市打折
FOURS_SHOP_FREE("10009", ""),
//浓雾
FOURS_FOG("10010", "出现浓雾", "浓雾预警", R.drawable.v2x_icon_nongwu_vr,
"前方出现浓雾", "出现浓雾"),
//结冰
FOURS_ICE("10011", "路面结冰", content = "前方路面结冰", tts = "路面结冰"),
//停车场
FOURS_PARKING("10012", "停车场", content = "停车场附近", tts = "停车场"),
//事故
FOURS_ACCIDENT("10013", "交通事故", "前方交通事故", R.drawable.v2x_icon_jiaotongshigu_vr,
"前方交通事故", "交通事故"),
//重大事故
FOURS_ACCIDENT_01("1001301", "交通事故", "前方交通事故", R.drawable.v2x_icon_jiaotongshigu_vr,
"前方交通事故", "交通事故"),
//特大事故
FOURS_ACCIDENT_02("1001302", "交通事故", "前方交通事故", R.drawable.v2x_icon_jiaotongshigu_vr,
"前方交通事故", "交通事故"),
//较大事故
FOURS_ACCIDENT_03("1001303", "交通事故", "前方交通事故", R.drawable.v2x_icon_jiaotongshigu_vr,
"前方交通事故", "交通事故"),
//一般事故
FOURS_ACCIDENT_04("1001304", "交通事故", "前方交通事故", R.drawable.v2x_icon_jiaotongshigu_vr,
"前方交通事故", "交通事故"),
//轻微事故
FOURS_ACCIDENT_05("1001305", "交通事故", "前方交通事故", R.drawable.v2x_icon_jiaotongshigu_vr,
"前方交通事故", "交通事故"),
//身边
FOURS_NEALY("10014", "身边事件"),
//实时路况
FOURS_LIVING("10015", "实时路况"),
//违章停车
ILLEGAL_PARK_LIVING("10016"),
//路面湿滑
ROAD_SLIPPERY("10021"),
// 前方静止or慢速车辆报警
ALERT_FRONT_CAR("99999"),
// 限行管理
ALERT_TRAFFIC_CONTROL("99998"),
// 红绿灯事件、是建议以多少速度驶过
ALERT_TRAFFIC_LIGHT_SUGGEST("99997"),
// 红绿灯事件、一种是绿灯不足3秒
ALERT_TRAFFIC_LIGHT_WARNING("99996"),
// 故障车辆
ALERT_CAR_TROUBLE_WARNING("20007"),
// 疲劳驾驶
ALERT_FATIGUE_DRIVING("99993"),
// 违章停车
ALERT_ILLEGAL_PARK("99992"),
// TODO 这里目前是演示DEMO会用到想着是打算商用先这么处理的
// 取快递
ALERT_TRAFFIC_EXPRESS("99995"),
// 顺风车
ALERT_TRAFFIC_TAXI("99994"),
TYPE_USECASE_ID_EBW(
ObuConstants.USE_CASE_ID.EBW.toString(),
"紧急制动预警",
poiTypeSrcVr=R.drawable.icon_warning_v2x_emergency_brake,
content="前车急刹车",
tts = "前车急刹车"
),
TYPE_USECASE_ID_FCW(
ObuConstants.USE_CASE_ID.FCW.toString(),
"前向碰撞预警",
poiTypeSrcVr=R.drawable.icon_warning_v2x_collision_warning,
content="前车碰撞预警",
tts="小心前车"
),
TYPE_USECASE_ID_ICW(
ObuConstants.USE_CASE_ID.ICW.toString(),
"交叉路口碰撞预警",
poiTypeSrcVr=R.drawable.icon_warning_v2x_collision_warning,
content="交叉路口碰撞预警",
tts="注意交叉路口车辆"
),
TYPE_USECASE_ID_CLW(
ObuConstants.USE_CASE_ID.CLW.toString(),
"车辆失控预警",
poiTypeSrcVr=R.drawable.icon_warning_v2x_vehicle_control,
content="前%s失控预警",
tts="小心%s失控车辆"
),
TYPE_USECASE_ID_DNPW(
ObuConstants.USE_CASE_ID.DNPW.toString(),
"逆向超车预警",
poiTypeSrcVr=R.drawable.icon_warning_v2x_reverse_overtaking,
content="逆向超车预警",
tts="注意对向来车"
),
TYPE_USECASE_ID_AVW(
ObuConstants.USE_CASE_ID.AVW.toString(),
"异常车辆提醒",
poiTypeSrcVr=R.drawable.icon_warning_v2x_abnormal_vehicle,
content="%s车异常",
tts="小心%s异常车辆"
),
TYPE_USECASE_ID_BSW(
ObuConstants.USE_CASE_ID.BSW.toString(),
"盲区预警",
poiTypeSrcVr=R.drawable.icon_warning_v2x_blind_area_collision,
content="%s后盲区预警",
tts="注意%s后车辆"
),
TYPE_USECASE_ID_LCW(
ObuConstants.USE_CASE_ID.LCW.toString(),
"变道预警",
poiTypeSrcVr=R.drawable.icon_warning_v2x_reverse_overtaking,
content="%s向变道预警",
tts="注意%s后车辆"
),//注意左后车辆/注意右后车辆
TYPE_USECASE_ID_EVW(
ObuConstants.USE_CASE_ID.EVW.toString(),
"紧急车辆提醒",
poiTypeSrcVr=R.drawable.icon_warning_v2x_special_vehicle_access,
content="请避让特种车辆",
tts="后方特种车辆请避让"
),
TYPE_USECASE_ID_VRUCW_PERSON(
0X2B0201.toString(),
"弱势交通参与者碰撞预警",
poiTypeSrcVr=R.drawable.icon_warning_v2x_pedestrian_crossing,
content="行人碰撞预警",
tts="行人碰撞预警"
),//行人/摩托车碰撞预警
TYPE_USECASE_ID_VRUCW_MOTORBIKE(
0X2B0202.toString(),
"弱势交通参与者碰撞预警",
poiTypeSrcVr=R.drawable.icon_warning_v2x_motorcycle_collision,
content="摩托车碰撞预警",
tts="摩托车碰撞预警"
),//摩托车碰撞预警
TYPE_USECASE_ID_SLW(
ObuConstants.USE_CASE_ID.SLW.toString(),
"限速预警",
poiTypeSrcVr=R.drawable.icon_warning_v2x_over_speed,
content="已超速",
tts=""
),
TYPE_USECASE_ID_LTA(
ObuConstants.USE_CASE_ID.LTA.toString(),
"左转辅助",
poiTypeSrcVr=R.drawable.icon_warning_v2x_collision_warning,
content="左转碰撞预警",
tts="注意%s后车辆"
),
TYPE_USECASE_ID_HLW(
ObuConstants.USE_CASE_ID.HLW.toString(),
"道路危险情况预警",
poiTypeSrcVr=R.drawable.icon_warning_v2x_road_dangerous,
content="道路危险情况预警",
tts="前方路况危险,小心行驶"
),//(如果能给出具体的类别,则播报具体危险类别)
TYPE_USECASE_ID_IVS(
ObuConstants.USE_CASE_ID.IVS.toString(),
"车内标牌",
poiTypeSrcVr=R.drawable.icon_warning_v2x_road_construction,
content="前方施工",
tts=""
),
TYPE_USECASE_ID_TJW(
ObuConstants.USE_CASE_ID.TJW.toString(),
"前方拥堵提醒",
poiTypeSrcVr=R.drawable.icon_warning_v2x_congestion,
content="前方道路拥堵",
tts="前方%d米道路拥堵请减速慢行"
),
TYPE_USECASE_ID_IVP(
ObuConstants.USE_CASE_ID.IVP.toString(),
"闯红灯预警",
poiTypeSrcVr=R.drawable.icon_warning_v2x_traffic_lights_red,
content="路口红灯,禁止通行",
tts="路口红灯,禁止通行"
),
TYPE_USECASE_ID_IVP_GREEN(
0x2B091.toString(),
"绿波通行",
poiTypeSrcVr=R.drawable.icon_warning_v2x_traffic_lights_green,
content="绿波通行 %s km/h",
tts="前方路口建议车速 %s 公里每小时"
),
TYPE_USECASE_ID_COC(
ObuConstants.USE_CASE_ID.COC.toString(),
"预留",
poiTypeSrcVr=R.drawable.icon_warning_v2x_abnormal_vehicle,
content="路况预警",
tts="路况预警"
),
TYPE_USECASE_ID_ROAD_TRAMCAR(
0x2C01.toString(),
"前方有轨电车提醒",
poiTypeSrcVr=R.drawable.icon_warning_v2x_tramcar,
content="前方有轨电车提醒",
tts="前方有轨电车经过,请注意行驶安全"
),
TYPE_USECASE_ID_ROAD_TURN_LEFT_SHARP(
0x2C02.toString(),
"前方左转急弯",
poiTypeSrcVr=R.drawable.icon_warning_v2x_turn_left_sharp,
content="前方左转急弯",
tts="前方路口左转急弯,请减速慢行",
),
TYPE_USECASE_ID_ROAD_TURN_RIGHT_SHARP(
0x2C03.toString(),
"前方右转急弯",
poiTypeSrcVr=R.drawable.icon_warning_v2x_turn_right_sharp,
content="前方右转急弯",
tts="前方路口右转急弯,请减速慢行"
),
TYPE_USECASE_ID_ROAD_PEDESTRIAN_CROSSING(
0x2C04.toString(),
"人行横道",
poiTypeSrcVr=R.drawable.icon_warning_v2x_pedestrian_crossing,
content="前方人行横道",
tts="前方人行横道"
),
TYPE_USECASE_ID_ROAD_PEDESTRIAN_SCHOOL(
0x2C05.toString(),
"学校",
poiTypeSrcVr=R.drawable.icon_warning_v2x_school,
content="前方学校,减速慢行",
tts="前方人行横道,请减速慢行"
),
TYPE_USECASE_ID_ROAD_COLLISION_WARNING(
0x2C06.toString(),
"事故易发路段",
poiTypeSrcVr=R.drawable.icon_warning_v2x_collision_warning,
content="当前路段事故多发",
tts="当前路段事故多发,请谨慎行驶"
),
TYPE_USECASE_ID_ROAD_ROUNDABOUTPNG(
0x2C07.toString(),
"环岛行驶",
poiTypeSrcVr=R.drawable.icon_warning_v2x_roundaboutpng,
content="前方驶入环岛",
tts="前方驶入环岛,请谨慎行驶"
),
TYPE_USECASE_ID_ROAD_TEST_SECTION(
0x2C08.toString(),
"驾校考试路段",
poiTypeSrcVr=R.drawable.icon_warning_v2x_test_section,
content="前方考试路段",
tts="前方考试路段,减速慢行"
),
TYPE_USECASE_ID_ROAD_HUMP_BRIDGE(
0x2C09.toString(),
"驼峰桥",
poiTypeSrcVr=R.drawable.icon_warning_v2x_hump_bridge,
content="前方驼峰桥",
tts="即将驶入桥梁,请减速慢行"
),
TYPE_USECASE_ID_ROAD_NO_PARKING(
0x2C10.toString(),
"禁止停车",
poiTypeSrcVr=R.drawable.icon_warning_v2x_no_parking,
content="当前路段禁止停车",
tts="当前路段,禁止停车"
),
TYPE_USECASE_ID_ROAD_GIVE_WAY(
0x2C11.toString(),
"减速慢行",
poiTypeSrcVr=R.drawable.icon_warning_v2x_give_way,
content="有车出入,减速慢行",
tts="有车出入,减速慢行"
),
TYPE_ERROR(
ObuConstants.USE_CASE_ID.ERROR.toString(),
"未知/错误/异常",
poiTypeSrcVr=R.drawable.icon_warning_v2x_abnormal_vehicle,
content="",
tts=""
);
companion object {
@JvmStatic
fun getPoiTypeStr(poiType: String): String {
// 先获取网络配置的poi对应的名称
CloudPoiManager.getInstance().getWrapperByPoiType(poiType)?.let {
return it.title
}
// 如果获取不到,那么就用本地默认的
return when (poiType) {
GAS_STATION.poiType -> GAS_STATION.poiTypeStr
TRAFFIC_CHECK.poiType -> TRAFFIC_CHECK.poiTypeStr
ROAD_CLOSED.poiType -> ROAD_CLOSED.poiTypeStr
SHOP_DISCOUNT.poiType -> SHOP_DISCOUNT.poiTypeStr
FOURS_4S.poiType -> FOURS_4S.poiTypeStr
FOURS_ROAD_WORK.poiType -> FOURS_ROAD_WORK.poiTypeStr
FOURS_BLOCK_UP.poiType -> FOURS_BLOCK_UP.poiTypeStr
FOURS_PONDING.poiType -> FOURS_PONDING.poiTypeStr
FOURS_SHOP_FREE.poiType -> FOURS_SHOP_FREE.poiTypeStr
FOURS_FOG.poiType -> FOURS_FOG.poiTypeStr
FOURS_ICE.poiType -> FOURS_ICE.poiTypeStr
FOURS_PARKING.poiType -> FOURS_PARKING.poiTypeStr
FOURS_ACCIDENT.poiType, FOURS_ACCIDENT_01.poiType,
FOURS_ACCIDENT_02.poiType, FOURS_ACCIDENT_03.poiType,
FOURS_ACCIDENT_04.poiType, FOURS_ACCIDENT_05.poiType -> FOURS_ACCIDENT.poiTypeStr
FOURS_NEALY.poiType -> FOURS_NEALY.poiTypeStr
FOURS_LIVING.poiType -> FOURS_LIVING.poiTypeStr
else -> "其它道路事件"
}
}
@JvmStatic
fun getPoiTypeStrVr(poiType: String): String {
return when (poiType) {
GAS_STATION.poiType -> GAS_STATION.poiTypeStrVr
TRAFFIC_CHECK.poiType -> TRAFFIC_CHECK.poiTypeStrVr
ROAD_CLOSED.poiType -> ROAD_CLOSED.poiTypeStrVr
SHOP_DISCOUNT.poiType -> SHOP_DISCOUNT.poiTypeStrVr
FOURS_4S.poiType -> FOURS_4S.poiTypeStrVr
FOURS_ROAD_WORK.poiType -> FOURS_ROAD_WORK.poiTypeStrVr
FOURS_BLOCK_UP.poiType -> FOURS_BLOCK_UP.poiTypeStrVr
FOURS_PONDING.poiType -> FOURS_PONDING.poiTypeStrVr
FOURS_SHOP_FREE.poiType -> FOURS_SHOP_FREE.poiTypeStrVr
FOURS_FOG.poiType -> FOURS_FOG.poiTypeStrVr
FOURS_ICE.poiType -> FOURS_ICE.poiTypeStrVr
FOURS_PARKING.poiType -> FOURS_PARKING.poiTypeStrVr
FOURS_ACCIDENT.poiType, FOURS_ACCIDENT_01.poiType,
FOURS_ACCIDENT_02.poiType, FOURS_ACCIDENT_03.poiType,
FOURS_ACCIDENT_04.poiType, FOURS_ACCIDENT_05.poiType -> FOURS_ACCIDENT.poiTypeStrVr
FOURS_NEALY.poiType -> FOURS_NEALY.poiTypeStrVr
FOURS_LIVING.poiType -> FOURS_LIVING.poiTypeStrVr
else -> "其它道路事件"
}
}
@JvmStatic
fun getPoiTypeSrcVr(poiType: String): Int {
return when (poiType) {
TRAFFIC_CHECK.poiType -> TRAFFIC_CHECK.poiTypeSrcVr
ROAD_CLOSED.poiType -> ROAD_CLOSED.poiTypeSrcVr
FOURS_4S.poiType -> FOURS_4S.poiTypeSrcVr
FOURS_ROAD_WORK.poiType -> FOURS_ROAD_WORK.poiTypeSrcVr
FOURS_BLOCK_UP.poiType -> FOURS_BLOCK_UP.poiTypeSrcVr
FOURS_PONDING.poiType -> FOURS_PONDING.poiTypeSrcVr
FOURS_SHOP_FREE.poiType -> FOURS_SHOP_FREE.poiTypeSrcVr
FOURS_FOG.poiType -> FOURS_FOG.poiTypeSrcVr
FOURS_ICE.poiType -> FOURS_ICE.poiTypeSrcVr
FOURS_PARKING.poiType -> FOURS_PARKING.poiTypeSrcVr
FOURS_ACCIDENT.poiType, FOURS_ACCIDENT_01.poiType,
FOURS_ACCIDENT_02.poiType, FOURS_ACCIDENT_03.poiType,
FOURS_ACCIDENT_04.poiType, FOURS_ACCIDENT_05.poiType -> FOURS_ACCIDENT.poiTypeSrcVr
FOURS_NEALY.poiType -> FOURS_NEALY.poiTypeSrcVr
FOURS_LIVING.poiType -> FOURS_LIVING.poiTypeSrcVr
else -> R.drawable.v2x_icon_live_logo
}
}
/**
* 获取道路事件的背景色
*/
@JvmStatic
fun getPoiTypeBg(poiType: String, isVrMode: Boolean): Int {
return when (poiType) {
FOURS_PARKING.poiType, GAS_STATION.poiType -> R.drawable.bg_v2x_event_type_blue
FOURS_BLOCK_UP.poiType, FOURS_LIVING.poiType, FOURS_NEALY.poiType -> if (isVrMode) R.drawable.bg_v2x_event_type_orange_vr else R.drawable.bg_v2x_event_type_orange
TRAFFIC_CHECK.poiType, ROAD_CLOSED.poiType, FOURS_ROAD_WORK.poiType,
FOURS_PONDING.poiType, FOURS_FOG.poiType, FOURS_ICE.poiType, FOURS_ACCIDENT.poiType,
FOURS_ACCIDENT_01.poiType, FOURS_ACCIDENT_02.poiType, FOURS_ACCIDENT_03.poiType,
FOURS_ACCIDENT_04.poiType, FOURS_ACCIDENT_05.poiType -> if (isVrMode) R.drawable.bg_v2x_event_type_red_vr else R.drawable.bg_v2x_event_type_read
else -> {
if (isVrMode) R.drawable.bg_v2x_event_type_red_vr else R.drawable.bg_v2x_event_type_read
}
}
}
@JvmStatic
fun getPoiTypeBgForShareItem(poiType: String): Int {
return when (poiType) {
FOURS_PARKING.poiType, GAS_STATION.poiType ->
R.drawable.bg_v2x_event_type_blue
FOURS_BLOCK_UP.poiType, FOURS_LIVING.poiType, FOURS_NEALY.poiType ->
R.drawable.bg_v2x_event_type_orange
TRAFFIC_CHECK.poiType, ROAD_CLOSED.poiType,
FOURS_ROAD_WORK.poiType, FOURS_PONDING.poiType,
FOURS_FOG.poiType, FOURS_ICE.poiType,
FOURS_ACCIDENT.poiType, FOURS_ACCIDENT_01.poiType,
FOURS_ACCIDENT_02.poiType, FOURS_ACCIDENT_03.poiType,
FOURS_ACCIDENT_04.poiType, FOURS_ACCIDENT_05.poiType ->
R.drawable.bg_v2x_event_type_read
else -> R.drawable.bg_v2x_event_type_read
}
}
/**
* 判断是否是道路预警事件
*/
@JvmStatic
fun isRoadEvent(poiType: String?): Boolean {
return when (poiType) {
TRAFFIC_CHECK.poiType, ROAD_CLOSED.poiType,
FOURS_ROAD_WORK.poiType, FOURS_BLOCK_UP.poiType,
FOURS_PONDING.poiType, FOURS_FOG.poiType,
FOURS_ICE.poiType, FOURS_ACCIDENT.poiType,
FOURS_ACCIDENT_01.poiType, FOURS_ACCIDENT_02.poiType,
FOURS_ACCIDENT_03.poiType, FOURS_ACCIDENT_04.poiType,
FOURS_ACCIDENT_05.poiType -> true
else -> false
}
}
/**
* 是否需要UGC预警
*/
@JvmStatic
fun isNeedRoadEventUgc(poiType: String?): Boolean {
return when (poiType) {
ROAD_CLOSED.poiType, FOURS_ROAD_WORK.poiType,
FOURS_BLOCK_UP.poiType, FOURS_ACCIDENT.poiType,
FOURS_ACCIDENT_01.poiType, FOURS_ACCIDENT_02.poiType,
FOURS_ACCIDENT_03.poiType, FOURS_ACCIDENT_04.poiType,
FOURS_ACCIDENT_05.poiType -> true
else -> false
}
}
/**
* 获取 UGC 问答使用的 Title 和 TTS 以及展示图表
*/
@JvmStatic
fun getUgcTitleStr(poiType: String?): Array<Any?>? {
val str = arrayOfNulls<Any>(5)
when (poiType) {
ROAD_CLOSED.poiType -> {
str[0] = "你刚经过 #### \n封路吗?"
str[1] = "你刚路过的路段封路吗?您可以直接对我说封路、或者不封路。"
str[2] = R.drawable.v_to_x_event_ugc_fenglu
str[3] = COMMAND_ZHIDAO_V2X_FEEDBACK_FENG_LU_YES_UN_WAKEUP
str[4] = COMMAND_ZHIDAO_V2X_FEEDBACK_FENG_LU_NO_UN_WAKEUP
}
FOURS_ROAD_WORK.poiType -> {
str[0] = "你刚经过 #### \n有道路施工吗?"
str[1] = "你刚路过的路段道路施工吗?您可以直接对我说有施工、或者没有施工。"
str[2] = R.drawable.bg_v2x_cancel_help
str[3] = COMMAND_ZHIDAO_V2X_FEEDBACK_SHI_GONG_YES_UN_WAKEUP
str[4] = COMMAND_ZHIDAO_V2X_FEEDBACK_SHI_GONG_NO_UN_WAKEUP
}
FOURS_BLOCK_UP.poiType -> {
str[0] = "你刚路过 #### \n堵不堵?"
str[1] = "你刚路过的路段堵不堵?您可以直接对我说拥赌、或者不堵。"
str[2] = R.drawable.v_to_x_event_ugc_yongdu
str[3] = COMMAND_ZHIDAO_V2X_FEEDBACK_YONG_DU_YES_UN_WAKEUP
str[4] = COMMAND_ZHIDAO_V2X_FEEDBACK_YONG_DU_NO_UN_WAKEUP
}
FOURS_ACCIDENT.poiType, FOURS_ACCIDENT_01.poiType, FOURS_ACCIDENT_02.poiType,
FOURS_ACCIDENT_03.poiType, FOURS_ACCIDENT_04.poiType, FOURS_ACCIDENT_05.poiType -> {
str[0] = "你刚经过 #### \n有事故发生吗?"
str[1] = "你刚路过的路段有交通事故吗?您可以直接对我说有事故、或者没有事故。"
str[2] = R.drawable.v_to_x_event_ugc_shigu
str[3] = COMMAND_ZHIDAO_V2X_FEEDBACK_SHI_GU_YES_UN_WAKEUP
str[4] = COMMAND_ZHIDAO_V2X_FEEDBACK_SHI_GU_NO_UN_WAKEUP
}
else -> return null
}
return str
}
@JvmStatic
fun getTts(poiType: String?): String {
return when (poiType) {
FOURS_PARKING.poiType -> FOURS_PARKING.tts
GAS_STATION.poiType -> GAS_STATION.tts
TRAFFIC_CHECK.poiType -> TRAFFIC_CHECK.tts
ROAD_CLOSED.poiType -> ROAD_CLOSED.tts
FOURS_ROAD_WORK.poiType -> FOURS_ROAD_WORK.tts
FOURS_BLOCK_UP.poiType -> FOURS_BLOCK_UP.tts
FOURS_PONDING.poiType -> FOURS_PONDING.tts
FOURS_FOG.poiType -> FOURS_FOG.tts
FOURS_ICE.poiType -> FOURS_ICE.tts
FOURS_ACCIDENT.poiType, FOURS_ACCIDENT_01.poiType, FOURS_ACCIDENT_02.poiType,
FOURS_ACCIDENT_03.poiType, FOURS_ACCIDENT_04.poiType, FOURS_ACCIDENT_05.poiType -> FOURS_ACCIDENT.tts
else -> "道路事件"
}
}
@JvmStatic
fun getTtsWithFeedback(poiType: String?): String {
return when (poiType) {
FOURS_PARKING.poiType -> "有停车场"
GAS_STATION.poiType -> "有加油站"
TRAFFIC_CHECK.poiType -> "交通检查"
ROAD_CLOSED.poiType -> "封路"
FOURS_ROAD_WORK.poiType -> "施工"
FOURS_BLOCK_UP.poiType -> "道路拥堵"
FOURS_PONDING.poiType -> "道路积水"
FOURS_FOG.poiType -> "出现浓雾"
FOURS_ICE.poiType -> "路面结冰"
FOURS_ACCIDENT.poiType, FOURS_ACCIDENT_01.poiType, FOURS_ACCIDENT_02.poiType,
FOURS_ACCIDENT_03.poiType, FOURS_ACCIDENT_04.poiType, FOURS_ACCIDENT_05.poiType -> "交通事故"
else -> "道路事件"
}
}
@JvmStatic
fun getAlarmContent(poiType: String?): String {
return when (poiType) {
FOURS_PARKING.poiType -> FOURS_PARKING.content
GAS_STATION.poiType -> GAS_STATION.content
TRAFFIC_CHECK.poiType -> TRAFFIC_CHECK.content
ROAD_CLOSED.poiType -> ROAD_CLOSED.content
FOURS_ROAD_WORK.poiType -> FOURS_ROAD_WORK.content
FOURS_BLOCK_UP.poiType -> FOURS_BLOCK_UP.content
FOURS_PONDING.poiType -> FOURS_PONDING.content
FOURS_FOG.poiType -> FOURS_FOG.content
FOURS_ICE.poiType -> FOURS_ICE.content
FOURS_ACCIDENT.poiType, FOURS_ACCIDENT_01.poiType, FOURS_ACCIDENT_02.poiType,
FOURS_ACCIDENT_03.poiType, FOURS_ACCIDENT_04.poiType, FOURS_ACCIDENT_05.poiType ->
FOURS_ACCIDENT.content
else -> "道路事件"
}
}
@JvmStatic
fun getTypeSmallRes(type: String): Int {
return when (type) {
TRAFFIC_CHECK.poiType ->
R.drawable.mogo_image_jiaotongjiancha_small
ROAD_CLOSED.poiType -> R.drawable.mogo_image_fenglu_small
FOURS_ROAD_WORK.poiType -> R.drawable.mogo_image_daolushigong_small
FOURS_BLOCK_UP.poiType -> R.drawable.mogo_image_yongdu_small
FOURS_PONDING.poiType -> R.drawable.mogo_image_jishui_small
FOURS_ICE.poiType -> R.drawable.mogo_image_jiebing_small
FOURS_FOG.poiType -> R.drawable.mogo_image_nongwu_small
FOURS_ACCIDENT.poiType, FOURS_ACCIDENT_01.poiType, FOURS_ACCIDENT_02.poiType,
FOURS_ACCIDENT_03.poiType, FOURS_ACCIDENT_04.poiType, FOURS_ACCIDENT_05.poiType ->
R.drawable.mogo_image_accident_small
else -> R.drawable.mogo_image_shishilukuang_small
}
}
@JvmStatic
fun getTypeRes(type: String): Int {
return when (type) {
TRAFFIC_CHECK.poiType -> R.drawable.mogo_image_jiaotongjiancha_nor
ROAD_CLOSED.poiType -> R.drawable.mogo_image_fenglu_nor
FOURS_ROAD_WORK.poiType -> R.drawable.mogo_image_daolushigong_nor
FOURS_BLOCK_UP.poiType -> R.drawable.mogo_image_yongdu_nor
FOURS_PONDING.poiType -> R.drawable.mogo_image_jishui_nor
FOURS_ICE.poiType -> R.drawable.mogo_image_jiebing_nor
FOURS_FOG.poiType -> R.drawable.mogo_image_nongwu_nor
FOURS_ACCIDENT.poiType, FOURS_ACCIDENT_01.poiType, FOURS_ACCIDENT_02.poiType,
FOURS_ACCIDENT_03.poiType, FOURS_ACCIDENT_04.poiType, FOURS_ACCIDENT_05.poiType ->
R.drawable.mogo_image_jiaotongshigu_nor
else -> R.drawable.mogo_image_shishlukuang_nor
}
}
@JvmStatic
fun getTypeName(type: String?): String {
return when (type) {
ROAD_CLOSED.poiType -> "封路"
FOURS_ICE.poiType -> "道路结冰"
FOURS_FOG.poiType -> "浓雾"
TRAFFIC_CHECK.poiType -> "交通检查"
FOURS_ACCIDENT.poiType, FOURS_ACCIDENT_01.poiType, FOURS_ACCIDENT_02.poiType,
FOURS_ACCIDENT_03.poiType, FOURS_ACCIDENT_04.poiType, FOURS_ACCIDENT_05.poiType -> "交通事故"
FOURS_BLOCK_UP.poiType -> "拥堵"
FOURS_ROAD_WORK.poiType -> "施工"
FOURS_PONDING.poiType -> "道路积水"
else -> "实时路况"
}
}
@JvmStatic
fun getMarker3DRes(poiType: String?): Int {
return when (poiType) {
FOURS_BLOCK_UP.poiType -> R.raw.v2x_yongdu
FOURS_ACCIDENT.poiType -> R.raw.v2x_shigu
FOURS_LIVING.poiType -> R.raw.v2x_shishilukuang
FOURS_FOG.poiType -> R.raw.v2x_nongwu
TRAFFIC_CHECK.poiType -> R.raw.v2x_jiaotongjiancha
FOURS_ROAD_WORK.poiType -> R.raw.v2x_daolushigong
FOURS_ICE.poiType -> R.raw.v2x_daolujiebing
FOURS_PONDING.poiType -> R.raw.v2x_daolujishui
else -> 0
}
}
@JvmStatic
fun getTypeNameTTS(type: String?): String {
return when (type) {
ROAD_CLOSED.poiType -> "封路"
FOURS_ICE.poiType -> "道路结冰"
FOURS_FOG.poiType -> "浓雾"
TRAFFIC_CHECK.poiType -> "交通检查"
FOURS_ACCIDENT.poiType, FOURS_ACCIDENT_01.poiType, FOURS_ACCIDENT_02.poiType,
FOURS_ACCIDENT_03.poiType, FOURS_ACCIDENT_04.poiType, FOURS_ACCIDENT_05.poiType -> "交通事故"
FOURS_BLOCK_UP.poiType -> "拥堵"
FOURS_ROAD_WORK.poiType -> "施工"
FOURS_PONDING.poiType -> "道路积水"
else -> "实时路况"
}
}
@JvmStatic
fun getUpdateIconRes(poiType: String?): Int {
return when (poiType) {
//交通检查
TRAFFIC_CHECK.poiType -> {
R.drawable.v_to_x_marker_2
}
//封路
ROAD_CLOSED.poiType -> {
R.drawable.v_to_x_marker_16
}
//施工
FOURS_ROAD_WORK.poiType -> {
R.drawable.v_to_x_marker_11
}
//拥堵
FOURS_BLOCK_UP.poiType -> {
R.drawable.v_to_x_marker_5
}
//积水
FOURS_PONDING.poiType -> {
R.drawable.v_to_x_marker_6
}
//浓雾
FOURS_FOG.poiType -> {
R.drawable.v_to_x_marker_9
}
//结冰
FOURS_ICE.poiType -> {
R.drawable.v_to_x_marker_8
}
//事故
FOURS_ACCIDENT.poiType -> {
R.drawable.v_to_x_marker_7
}
//事故
FOURS_LIVING.poiType -> {
R.drawable.v_to_x_marker_1
}
//红绿灯数据
ALERT_TRAFFIC_LIGHT_SUGGEST.poiType -> {
R.drawable.v_to_x_marker_3
}
//红绿灯数据
ALERT_TRAFFIC_LIGHT_WARNING.poiType -> {
R.drawable.v_to_x_marker_3
}
//前方静止or慢速车辆报警
ALERT_FRONT_CAR.poiType -> {
R.drawable.v_to_x_warning_car_red
}
// 故障车辆
ALERT_CAR_TROUBLE_WARNING.poiType -> {
R.drawable.icon_car_red
}
// 取快递
ALERT_TRAFFIC_EXPRESS.poiType -> {
R.drawable.v_to_x_marker_express
}
// 顺风车
ALERT_TRAFFIC_TAXI.poiType -> {
R.drawable.v_to_x_marker_taxi
}
else -> 0
}
}
//===================告警类事件===================
@JvmStatic
fun getWarningIcon(poiType: String?): Int {
return when (poiType) {
TYPE_USECASE_ID_EBW.poiType -> TYPE_USECASE_ID_EBW.poiTypeSrcVr
TYPE_USECASE_ID_FCW.poiType -> TYPE_USECASE_ID_FCW.poiTypeSrcVr
TYPE_USECASE_ID_ICW.poiType -> TYPE_USECASE_ID_ICW.poiTypeSrcVr
TYPE_USECASE_ID_CLW.poiType -> TYPE_USECASE_ID_CLW.poiTypeSrcVr
TYPE_USECASE_ID_DNPW.poiType -> TYPE_USECASE_ID_DNPW.poiTypeSrcVr
TYPE_USECASE_ID_AVW.poiType -> TYPE_USECASE_ID_AVW.poiTypeSrcVr
TYPE_USECASE_ID_BSW.poiType -> TYPE_USECASE_ID_BSW.poiTypeSrcVr
TYPE_USECASE_ID_LCW.poiType -> TYPE_USECASE_ID_LCW.poiTypeSrcVr
TYPE_USECASE_ID_EVW.poiType -> TYPE_USECASE_ID_EVW.poiTypeSrcVr
TYPE_USECASE_ID_VRUCW_PERSON.poiType -> TYPE_USECASE_ID_VRUCW_PERSON.poiTypeSrcVr
TYPE_USECASE_ID_VRUCW_MOTORBIKE.poiType -> TYPE_USECASE_ID_VRUCW_MOTORBIKE.poiTypeSrcVr
TYPE_USECASE_ID_SLW.poiType -> TYPE_USECASE_ID_SLW.poiTypeSrcVr
TYPE_USECASE_ID_LTA.poiType -> TYPE_USECASE_ID_LTA.poiTypeSrcVr
TYPE_USECASE_ID_HLW.poiType -> TYPE_USECASE_ID_HLW.poiTypeSrcVr
TYPE_USECASE_ID_IVS.poiType -> TYPE_USECASE_ID_IVS.poiTypeSrcVr
TYPE_USECASE_ID_TJW.poiType -> TYPE_USECASE_ID_TJW.poiTypeSrcVr
TYPE_USECASE_ID_IVP.poiType -> TYPE_USECASE_ID_IVP.poiTypeSrcVr
TYPE_USECASE_ID_IVP_GREEN.poiType -> TYPE_USECASE_ID_IVP_GREEN.poiTypeSrcVr
TYPE_USECASE_ID_COC.poiType -> TYPE_USECASE_ID_COC.poiTypeSrcVr
TYPE_USECASE_ID_ROAD_TRAMCAR.poiType -> TYPE_USECASE_ID_ROAD_TRAMCAR.poiTypeSrcVr
TYPE_USECASE_ID_ROAD_TURN_LEFT_SHARP.poiType -> TYPE_USECASE_ID_ROAD_TURN_LEFT_SHARP.poiTypeSrcVr
TYPE_USECASE_ID_ROAD_TURN_RIGHT_SHARP.poiType -> TYPE_USECASE_ID_ROAD_TURN_RIGHT_SHARP.poiTypeSrcVr
TYPE_USECASE_ID_ROAD_PEDESTRIAN_CROSSING.poiType -> TYPE_USECASE_ID_ROAD_PEDESTRIAN_CROSSING.poiTypeSrcVr
TYPE_USECASE_ID_ROAD_PEDESTRIAN_SCHOOL.poiType -> TYPE_USECASE_ID_ROAD_PEDESTRIAN_SCHOOL.poiTypeSrcVr
TYPE_USECASE_ID_ROAD_COLLISION_WARNING.poiType -> TYPE_USECASE_ID_ROAD_COLLISION_WARNING.poiTypeSrcVr
TYPE_USECASE_ID_ROAD_ROUNDABOUTPNG.poiType -> TYPE_USECASE_ID_ROAD_ROUNDABOUTPNG.poiTypeSrcVr
TYPE_USECASE_ID_ROAD_TEST_SECTION.poiType -> TYPE_USECASE_ID_ROAD_TEST_SECTION.poiTypeSrcVr
TYPE_USECASE_ID_ROAD_HUMP_BRIDGE.poiType -> TYPE_USECASE_ID_ROAD_HUMP_BRIDGE.poiTypeSrcVr
TYPE_USECASE_ID_ROAD_NO_PARKING.poiType -> TYPE_USECASE_ID_ROAD_NO_PARKING.poiTypeSrcVr
TYPE_USECASE_ID_ROAD_GIVE_WAY.poiType -> TYPE_USECASE_ID_ROAD_GIVE_WAY.poiTypeSrcVr
TYPE_ERROR.poiType -> TYPE_ERROR.poiTypeSrcVr
else -> TYPE_USECASE_ID_AVW.poiTypeSrcVr
}
}
@JvmStatic
fun getWarningContent(poiType: String?): String {
return when (poiType) {
TYPE_USECASE_ID_EBW.poiType -> TYPE_USECASE_ID_EBW.content
TYPE_USECASE_ID_FCW.poiType -> TYPE_USECASE_ID_FCW.content
TYPE_USECASE_ID_ICW.poiType -> TYPE_USECASE_ID_ICW.content
TYPE_USECASE_ID_CLW.poiType -> TYPE_USECASE_ID_CLW.content
TYPE_USECASE_ID_DNPW.poiType -> TYPE_USECASE_ID_DNPW.content
TYPE_USECASE_ID_AVW.poiType -> TYPE_USECASE_ID_AVW.content
TYPE_USECASE_ID_BSW.poiType -> TYPE_USECASE_ID_BSW.content
TYPE_USECASE_ID_LCW.poiType -> TYPE_USECASE_ID_LCW.content
TYPE_USECASE_ID_EVW.poiType -> TYPE_USECASE_ID_EVW.content
TYPE_USECASE_ID_VRUCW_PERSON.poiType -> TYPE_USECASE_ID_VRUCW_PERSON.content
TYPE_USECASE_ID_VRUCW_MOTORBIKE.poiType -> TYPE_USECASE_ID_VRUCW_MOTORBIKE.content
TYPE_USECASE_ID_SLW.poiType -> TYPE_USECASE_ID_SLW.content
TYPE_USECASE_ID_LTA.poiType -> TYPE_USECASE_ID_LTA.content
TYPE_USECASE_ID_HLW.poiType -> TYPE_USECASE_ID_HLW.content
TYPE_USECASE_ID_IVS.poiType -> TYPE_USECASE_ID_IVS.content
TYPE_USECASE_ID_TJW.poiType -> TYPE_USECASE_ID_TJW.content
TYPE_USECASE_ID_IVP.poiType -> TYPE_USECASE_ID_IVP.content
TYPE_USECASE_ID_IVP_GREEN.poiType -> TYPE_USECASE_ID_IVP_GREEN.content
TYPE_USECASE_ID_COC.poiType -> TYPE_USECASE_ID_COC.content
TYPE_USECASE_ID_ROAD_TRAMCAR.poiType -> TYPE_USECASE_ID_ROAD_TRAMCAR.content
TYPE_USECASE_ID_ROAD_TURN_LEFT_SHARP.poiType -> TYPE_USECASE_ID_ROAD_TURN_LEFT_SHARP.content
TYPE_USECASE_ID_ROAD_TURN_RIGHT_SHARP.poiType -> TYPE_USECASE_ID_ROAD_TURN_RIGHT_SHARP.content
TYPE_USECASE_ID_ROAD_PEDESTRIAN_CROSSING.poiType -> TYPE_USECASE_ID_ROAD_PEDESTRIAN_CROSSING.content
TYPE_USECASE_ID_ROAD_PEDESTRIAN_SCHOOL.poiType -> TYPE_USECASE_ID_ROAD_PEDESTRIAN_SCHOOL.content
TYPE_USECASE_ID_ROAD_COLLISION_WARNING.poiType -> TYPE_USECASE_ID_ROAD_COLLISION_WARNING.content
TYPE_USECASE_ID_ROAD_ROUNDABOUTPNG.poiType -> TYPE_USECASE_ID_ROAD_ROUNDABOUTPNG.content
TYPE_USECASE_ID_ROAD_TEST_SECTION.poiType -> TYPE_USECASE_ID_ROAD_TEST_SECTION.content
TYPE_USECASE_ID_ROAD_HUMP_BRIDGE.poiType -> TYPE_USECASE_ID_ROAD_HUMP_BRIDGE.content
TYPE_USECASE_ID_ROAD_NO_PARKING.poiType -> TYPE_USECASE_ID_ROAD_NO_PARKING.content
TYPE_USECASE_ID_ROAD_GIVE_WAY.poiType -> TYPE_USECASE_ID_ROAD_GIVE_WAY.content
TYPE_ERROR.poiType -> TYPE_ERROR.content
else -> TYPE_USECASE_ID_AVW.content
}
}
@JvmStatic
fun getWarningTts(poiType: String?): String {
return when (poiType) {
TYPE_USECASE_ID_EBW.poiType -> TYPE_USECASE_ID_EBW.tts
TYPE_USECASE_ID_FCW.poiType -> TYPE_USECASE_ID_FCW.tts
TYPE_USECASE_ID_ICW.poiType -> TYPE_USECASE_ID_ICW.tts
TYPE_USECASE_ID_CLW.poiType -> TYPE_USECASE_ID_CLW.tts
TYPE_USECASE_ID_DNPW.poiType -> TYPE_USECASE_ID_DNPW.tts
TYPE_USECASE_ID_AVW.poiType -> TYPE_USECASE_ID_AVW.tts
TYPE_USECASE_ID_BSW.poiType -> TYPE_USECASE_ID_BSW.tts
TYPE_USECASE_ID_LCW.poiType -> TYPE_USECASE_ID_LCW.tts
TYPE_USECASE_ID_EVW.poiType -> TYPE_USECASE_ID_EVW.tts
TYPE_USECASE_ID_VRUCW_PERSON.poiType -> TYPE_USECASE_ID_VRUCW_PERSON.tts
TYPE_USECASE_ID_VRUCW_MOTORBIKE.poiType -> TYPE_USECASE_ID_VRUCW_MOTORBIKE.tts
TYPE_USECASE_ID_SLW.poiType -> TYPE_USECASE_ID_SLW.tts
TYPE_USECASE_ID_LTA.poiType -> TYPE_USECASE_ID_LTA.tts
TYPE_USECASE_ID_HLW.poiType -> TYPE_USECASE_ID_HLW.tts
TYPE_USECASE_ID_IVS.poiType -> TYPE_USECASE_ID_IVS.tts
TYPE_USECASE_ID_TJW.poiType -> TYPE_USECASE_ID_TJW.tts
TYPE_USECASE_ID_IVP.poiType -> TYPE_USECASE_ID_IVP.tts
TYPE_USECASE_ID_IVP_GREEN.poiType -> TYPE_USECASE_ID_IVP_GREEN.tts
TYPE_USECASE_ID_COC.poiType -> TYPE_USECASE_ID_COC.tts
TYPE_USECASE_ID_ROAD_TRAMCAR.poiType -> TYPE_USECASE_ID_ROAD_TRAMCAR.tts
TYPE_USECASE_ID_ROAD_TURN_LEFT_SHARP.poiType -> TYPE_USECASE_ID_ROAD_TURN_LEFT_SHARP.tts
TYPE_USECASE_ID_ROAD_TURN_RIGHT_SHARP.poiType -> TYPE_USECASE_ID_ROAD_TURN_RIGHT_SHARP.tts
TYPE_USECASE_ID_ROAD_PEDESTRIAN_CROSSING.poiType -> TYPE_USECASE_ID_ROAD_PEDESTRIAN_CROSSING.tts
TYPE_USECASE_ID_ROAD_PEDESTRIAN_SCHOOL.poiType -> TYPE_USECASE_ID_ROAD_PEDESTRIAN_SCHOOL.tts
TYPE_USECASE_ID_ROAD_COLLISION_WARNING.poiType -> TYPE_USECASE_ID_ROAD_COLLISION_WARNING.tts
TYPE_USECASE_ID_ROAD_ROUNDABOUTPNG.poiType -> TYPE_USECASE_ID_ROAD_ROUNDABOUTPNG.tts
TYPE_USECASE_ID_ROAD_TEST_SECTION.poiType -> TYPE_USECASE_ID_ROAD_TEST_SECTION.tts
TYPE_USECASE_ID_ROAD_HUMP_BRIDGE.poiType -> TYPE_USECASE_ID_ROAD_HUMP_BRIDGE.tts
TYPE_USECASE_ID_ROAD_NO_PARKING.poiType -> TYPE_USECASE_ID_ROAD_NO_PARKING.tts
TYPE_USECASE_ID_ROAD_GIVE_WAY.poiType -> TYPE_USECASE_ID_ROAD_GIVE_WAY.tts
TYPE_ERROR.poiType -> TYPE_ERROR.tts
else -> TYPE_USECASE_ID_AVW.tts
}
}
}
}

View File

@@ -1,392 +0,0 @@
package com.mogo.module.common.enums
import com.mogo.module.common.R
import com.zhidao.support.obu.constants.ObuConstants
/**
* author : donghongyu
* e-mail : 1358506549@qq.com
* date : 2020-01-1514:47
* desc : 预警类型枚举
* version: 1.0
*/
enum class WarningTypeEnum(
var useCaseId: Int,
var desc: String,
var warningContent: String,
var warningTts: String,
var warningIconId: Int
) {
TYPE_USECASE_ID_EBW(
ObuConstants.USE_CASE_ID.EBW,
"紧急制动预警",
"前车急刹车",
"前车急刹车",
R.drawable.icon_warning_v2x_emergency_brake
),
TYPE_USECASE_ID_FCW(
ObuConstants.USE_CASE_ID.FCW,
"前向碰撞预警",
"前车碰撞预警",
"小心前车",
R.drawable.icon_warning_v2x_collision_warning
),
TYPE_USECASE_ID_ICW(
ObuConstants.USE_CASE_ID.ICW,
"交叉路口碰撞预警",
"交叉路口碰撞预警",
"注意交叉路口车辆",
R.drawable.icon_warning_v2x_collision_warning
),
TYPE_USECASE_ID_CLW(
ObuConstants.USE_CASE_ID.CLW,
"车辆失控预警",
"%s失控预警",
"小心%s失控车辆",
R.drawable.icon_warning_v2x_vehicle_control
),
TYPE_USECASE_ID_DNPW(
ObuConstants.USE_CASE_ID.DNPW,
"逆向超车预警",
"逆向超车预警",
"注意对向来车",
R.drawable.icon_warning_v2x_reverse_overtaking
),
TYPE_USECASE_ID_AVW(
ObuConstants.USE_CASE_ID.AVW,
"异常车辆提醒",
"%s车异常",
"小心%s异常车辆",
R.drawable.icon_warning_v2x_abnormal_vehicle
),
TYPE_USECASE_ID_BSW(
ObuConstants.USE_CASE_ID.BSW,
"盲区预警",
"%s后盲区预警",
"注意%s后车辆",
R.drawable.icon_warning_v2x_blind_area_collision
),
TYPE_USECASE_ID_LCW(
ObuConstants.USE_CASE_ID.LCW,
"变道预警",
"%s向变道预警",
"注意%s后车辆",
R.drawable.icon_warning_v2x_reverse_overtaking
),//注意左后车辆/注意右后车辆
TYPE_USECASE_ID_EVW(
ObuConstants.USE_CASE_ID.EVW,
"紧急车辆提醒",
"请避让特种车辆",
"后方特种车辆请避让",
R.drawable.icon_warning_v2x_special_vehicle_access
),
TYPE_USECASE_ID_VRUCW_PERSON(
0X2B0201,
"弱势交通参与者碰撞预警",
"行人碰撞预警",
"行人碰撞预警",
R.drawable.icon_warning_v2x_pedestrian_crossing
),//行人/摩托车碰撞预警
TYPE_USECASE_ID_VRUCW_MOTORBIKE(
0X2B0202,
"弱势交通参与者碰撞预警",
"摩托车碰撞预警",
"摩托车碰撞预警",
R.drawable.icon_warning_v2x_motorcycle_collision
),//摩托车碰撞预警
TYPE_USECASE_ID_SLW(
ObuConstants.USE_CASE_ID.SLW,
"限速预警",
"已超速",
"",
R.drawable.icon_warning_v2x_over_speed
),
TYPE_USECASE_ID_LTA(
ObuConstants.USE_CASE_ID.LTA,
"左转辅助",
"左转碰撞预警",
"注意%s后车辆",
R.drawable.icon_warning_v2x_collision_warning
),
TYPE_USECASE_ID_HLW(
ObuConstants.USE_CASE_ID.HLW,
"道路危险情况预警",
"道路危险情况预警",
"前方路况危险,小心行驶",
R.drawable.icon_warning_v2x_road_dangerous
),//(如果能给出具体的类别,则播报具体危险类别)
TYPE_USECASE_ID_IVS(
ObuConstants.USE_CASE_ID.IVS,
"车内标牌",
"前方施工",
"",
R.drawable.icon_warning_v2x_road_construction
),
TYPE_USECASE_ID_TJW(
ObuConstants.USE_CASE_ID.TJW,
"前方拥堵提醒",
"前方道路拥堵",
"前方%d米道路拥堵请减速慢行",
R.drawable.icon_warning_v2x_congestion
),
TYPE_USECASE_ID_IVP(
ObuConstants.USE_CASE_ID.IVP,
"闯红灯预警",
"路口红灯,禁止通行",
"路口红灯,禁止通行",
R.drawable.icon_warning_v2x_traffic_lights_red
),
TYPE_USECASE_ID_IVP_GREEN(
0x2B091,
"绿波通行",
"绿波通行 %s km/h",
"前方路口建议车速 %s 公里每小时",
R.drawable.icon_warning_v2x_traffic_lights_green
),
TYPE_USECASE_ID_COC(
ObuConstants.USE_CASE_ID.COC,
"预留",
"路况预警",
"路况预警",
R.drawable.icon_warning_v2x_abnormal_vehicle
),
TYPE_USECASE_ID_ROAD_TRAMCAR(
0x2C01,
"前方有轨电车提醒",
"前方有轨电车提醒",
"前方有轨电车经过,请注意行驶安全",
R.drawable.icon_warning_v2x_tramcar
),
TYPE_USECASE_ID_ROAD_TURN_LEFT_SHARP(
0x2C02,
"前方左转急弯",
"前方左转急弯",
"前方路口左转急弯,请减速慢行",
R.drawable.icon_warning_v2x_turn_left_sharp
),
TYPE_USECASE_ID_ROAD_TURN_RIGHT_SHARP(
0x2C03,
"前方右转急弯",
"前方右转急弯",
"前方路口右转急弯,请减速慢行",
R.drawable.icon_warning_v2x_turn_right_sharp
),
TYPE_USECASE_ID_ROAD_PEDESTRIAN_CROSSING(
0x2C04,
"人行横道",
"前方人行横道",
"前方人行横道",
R.drawable.icon_warning_v2x_pedestrian_crossing
),
TYPE_USECASE_ID_ROAD_PEDESTRIAN_SCHOOL(
0x2C05,
"学校",
"前方学校,减速慢行",
"前方人行横道,请减速慢行",
R.drawable.icon_warning_v2x_school
),
TYPE_USECASE_ID_ROAD_COLLISION_WARNING(
0x2C06,
"事故易发路段",
"当前路段事故多发",
"当前路段事故多发,请谨慎行驶",
R.drawable.icon_warning_v2x_collision_warning
),
TYPE_USECASE_ID_ROAD_ROUNDABOUTPNG(
0x2C07,
"环岛行驶",
"前方驶入环岛",
"前方驶入环岛,请谨慎行驶",
R.drawable.icon_warning_v2x_roundaboutpng
),
TYPE_USECASE_ID_ROAD_TEST_SECTION(
0x2C08,
"驾校考试路段",
"前方考试路段",
"前方考试路段,减速慢行",
R.drawable.icon_warning_v2x_test_section
),
TYPE_USECASE_ID_ROAD_HUMP_BRIDGE(
0x2C09,
"驼峰桥",
"前方驼峰桥",
"即将驶入桥梁,请减速慢行",
R.drawable.icon_warning_v2x_hump_bridge
),
TYPE_USECASE_ID_ROAD_NO_PARKING(
0x2C10,
"禁止停车",
"当前路段禁止停车",
"当前路段,禁止停车",
R.drawable.icon_warning_v2x_no_parking
),
TYPE_USECASE_ID_ROAD_GIVE_WAY(
0x2C11,
"减速慢行",
"有车出入,减速慢行",
"有车出入,减速慢行",
R.drawable.icon_warning_v2x_give_way
),
TYPE_ERROR(
ObuConstants.USE_CASE_ID.ERROR,
"未知/错误/异常",
"",
"",
R.drawable.icon_warning_v2x_abnormal_vehicle
);
companion object {
fun getWarningType(useCaseId: Int): WarningTypeEnum {
return when (useCaseId) {
ObuConstants.USE_CASE_ID.EBW -> TYPE_USECASE_ID_EBW
ObuConstants.USE_CASE_ID.FCW -> TYPE_USECASE_ID_FCW
ObuConstants.USE_CASE_ID.ICW -> TYPE_USECASE_ID_ICW
ObuConstants.USE_CASE_ID.CLW -> TYPE_USECASE_ID_CLW
ObuConstants.USE_CASE_ID.DNPW -> TYPE_USECASE_ID_DNPW
ObuConstants.USE_CASE_ID.AVW -> TYPE_USECASE_ID_AVW
ObuConstants.USE_CASE_ID.BSW -> TYPE_USECASE_ID_BSW
ObuConstants.USE_CASE_ID.LCW -> TYPE_USECASE_ID_LCW
ObuConstants.USE_CASE_ID.EVW -> TYPE_USECASE_ID_EVW
TYPE_USECASE_ID_VRUCW_PERSON.useCaseId -> TYPE_USECASE_ID_VRUCW_PERSON
TYPE_USECASE_ID_VRUCW_MOTORBIKE.useCaseId -> TYPE_USECASE_ID_VRUCW_MOTORBIKE
ObuConstants.USE_CASE_ID.SLW -> TYPE_USECASE_ID_SLW
ObuConstants.USE_CASE_ID.LTA -> TYPE_USECASE_ID_LTA
ObuConstants.USE_CASE_ID.HLW -> TYPE_USECASE_ID_HLW
ObuConstants.USE_CASE_ID.IVS -> TYPE_USECASE_ID_IVS
ObuConstants.USE_CASE_ID.TJW -> TYPE_USECASE_ID_TJW
ObuConstants.USE_CASE_ID.IVP -> TYPE_USECASE_ID_IVP
TYPE_USECASE_ID_IVP_GREEN.useCaseId -> TYPE_USECASE_ID_IVP_GREEN
ObuConstants.USE_CASE_ID.COC -> TYPE_USECASE_ID_COC
TYPE_USECASE_ID_ROAD_TRAMCAR.useCaseId -> TYPE_USECASE_ID_ROAD_TRAMCAR
TYPE_USECASE_ID_ROAD_TURN_LEFT_SHARP.useCaseId -> TYPE_USECASE_ID_ROAD_TURN_LEFT_SHARP
TYPE_USECASE_ID_ROAD_TURN_RIGHT_SHARP.useCaseId -> TYPE_USECASE_ID_ROAD_TURN_RIGHT_SHARP
TYPE_USECASE_ID_ROAD_PEDESTRIAN_CROSSING.useCaseId -> TYPE_USECASE_ID_ROAD_PEDESTRIAN_CROSSING
TYPE_USECASE_ID_ROAD_PEDESTRIAN_SCHOOL.useCaseId -> TYPE_USECASE_ID_ROAD_PEDESTRIAN_SCHOOL
TYPE_USECASE_ID_ROAD_COLLISION_WARNING.useCaseId -> TYPE_USECASE_ID_ROAD_COLLISION_WARNING
TYPE_USECASE_ID_ROAD_ROUNDABOUTPNG.useCaseId -> TYPE_USECASE_ID_ROAD_ROUNDABOUTPNG
TYPE_USECASE_ID_ROAD_TEST_SECTION.useCaseId -> TYPE_USECASE_ID_ROAD_TEST_SECTION
TYPE_USECASE_ID_ROAD_HUMP_BRIDGE.useCaseId -> TYPE_USECASE_ID_ROAD_HUMP_BRIDGE
TYPE_USECASE_ID_ROAD_NO_PARKING.useCaseId -> TYPE_USECASE_ID_ROAD_NO_PARKING
TYPE_USECASE_ID_ROAD_GIVE_WAY.useCaseId -> TYPE_USECASE_ID_ROAD_GIVE_WAY
ObuConstants.USE_CASE_ID.ERROR -> TYPE_ERROR
else -> TYPE_USECASE_ID_AVW
}
}
fun getWarningIcon(useCaseId: Int): Int {
return when (useCaseId) {
ObuConstants.USE_CASE_ID.EBW -> TYPE_USECASE_ID_EBW.warningIconId
ObuConstants.USE_CASE_ID.FCW -> TYPE_USECASE_ID_FCW.warningIconId
ObuConstants.USE_CASE_ID.ICW -> TYPE_USECASE_ID_ICW.warningIconId
ObuConstants.USE_CASE_ID.CLW -> TYPE_USECASE_ID_CLW.warningIconId
ObuConstants.USE_CASE_ID.DNPW -> TYPE_USECASE_ID_DNPW.warningIconId
ObuConstants.USE_CASE_ID.AVW -> TYPE_USECASE_ID_AVW.warningIconId
ObuConstants.USE_CASE_ID.BSW -> TYPE_USECASE_ID_BSW.warningIconId
ObuConstants.USE_CASE_ID.LCW -> TYPE_USECASE_ID_LCW.warningIconId
ObuConstants.USE_CASE_ID.EVW -> TYPE_USECASE_ID_EVW.warningIconId
TYPE_USECASE_ID_VRUCW_PERSON.useCaseId -> TYPE_USECASE_ID_VRUCW_PERSON.warningIconId
TYPE_USECASE_ID_VRUCW_MOTORBIKE.useCaseId -> TYPE_USECASE_ID_VRUCW_MOTORBIKE.warningIconId
ObuConstants.USE_CASE_ID.SLW -> TYPE_USECASE_ID_SLW.warningIconId
ObuConstants.USE_CASE_ID.LTA -> TYPE_USECASE_ID_LTA.warningIconId
ObuConstants.USE_CASE_ID.HLW -> TYPE_USECASE_ID_HLW.warningIconId
ObuConstants.USE_CASE_ID.IVS -> TYPE_USECASE_ID_IVS.warningIconId
ObuConstants.USE_CASE_ID.TJW -> TYPE_USECASE_ID_TJW.warningIconId
ObuConstants.USE_CASE_ID.IVP -> TYPE_USECASE_ID_IVP.warningIconId
TYPE_USECASE_ID_IVP_GREEN.useCaseId -> TYPE_USECASE_ID_IVP_GREEN.warningIconId
ObuConstants.USE_CASE_ID.COC -> TYPE_USECASE_ID_COC.warningIconId
TYPE_USECASE_ID_ROAD_TRAMCAR.useCaseId -> TYPE_USECASE_ID_ROAD_TRAMCAR.warningIconId
TYPE_USECASE_ID_ROAD_TURN_LEFT_SHARP.useCaseId -> TYPE_USECASE_ID_ROAD_TURN_LEFT_SHARP.warningIconId
TYPE_USECASE_ID_ROAD_TURN_RIGHT_SHARP.useCaseId -> TYPE_USECASE_ID_ROAD_TURN_RIGHT_SHARP.warningIconId
TYPE_USECASE_ID_ROAD_PEDESTRIAN_CROSSING.useCaseId -> TYPE_USECASE_ID_ROAD_PEDESTRIAN_CROSSING.warningIconId
TYPE_USECASE_ID_ROAD_PEDESTRIAN_SCHOOL.useCaseId -> TYPE_USECASE_ID_ROAD_PEDESTRIAN_SCHOOL.warningIconId
TYPE_USECASE_ID_ROAD_COLLISION_WARNING.useCaseId -> TYPE_USECASE_ID_ROAD_COLLISION_WARNING.warningIconId
TYPE_USECASE_ID_ROAD_ROUNDABOUTPNG.useCaseId -> TYPE_USECASE_ID_ROAD_ROUNDABOUTPNG.warningIconId
TYPE_USECASE_ID_ROAD_TEST_SECTION.useCaseId -> TYPE_USECASE_ID_ROAD_TEST_SECTION.warningIconId
TYPE_USECASE_ID_ROAD_HUMP_BRIDGE.useCaseId -> TYPE_USECASE_ID_ROAD_HUMP_BRIDGE.warningIconId
TYPE_USECASE_ID_ROAD_NO_PARKING.useCaseId -> TYPE_USECASE_ID_ROAD_NO_PARKING.warningIconId
TYPE_USECASE_ID_ROAD_GIVE_WAY.useCaseId -> TYPE_USECASE_ID_ROAD_GIVE_WAY.warningIconId
ObuConstants.USE_CASE_ID.ERROR -> TYPE_ERROR.warningIconId
else -> TYPE_USECASE_ID_AVW.warningIconId
}
}
fun getWarningContent(useCaseId: Int): String {
return when (useCaseId) {
ObuConstants.USE_CASE_ID.EBW -> TYPE_USECASE_ID_EBW.warningContent
ObuConstants.USE_CASE_ID.FCW -> TYPE_USECASE_ID_FCW.warningContent
ObuConstants.USE_CASE_ID.ICW -> TYPE_USECASE_ID_ICW.warningContent
ObuConstants.USE_CASE_ID.CLW -> TYPE_USECASE_ID_CLW.warningContent
ObuConstants.USE_CASE_ID.DNPW -> TYPE_USECASE_ID_DNPW.warningContent
ObuConstants.USE_CASE_ID.AVW -> TYPE_USECASE_ID_AVW.warningContent
ObuConstants.USE_CASE_ID.BSW -> TYPE_USECASE_ID_BSW.warningContent
ObuConstants.USE_CASE_ID.LCW -> TYPE_USECASE_ID_LCW.warningContent
ObuConstants.USE_CASE_ID.EVW -> TYPE_USECASE_ID_EVW.warningContent
TYPE_USECASE_ID_VRUCW_PERSON.useCaseId -> TYPE_USECASE_ID_VRUCW_PERSON.warningContent
TYPE_USECASE_ID_VRUCW_MOTORBIKE.useCaseId -> TYPE_USECASE_ID_VRUCW_MOTORBIKE.warningContent
ObuConstants.USE_CASE_ID.SLW -> TYPE_USECASE_ID_SLW.warningContent
ObuConstants.USE_CASE_ID.LTA -> TYPE_USECASE_ID_LTA.warningContent
ObuConstants.USE_CASE_ID.HLW -> TYPE_USECASE_ID_HLW.warningContent
ObuConstants.USE_CASE_ID.IVS -> TYPE_USECASE_ID_IVS.warningContent
ObuConstants.USE_CASE_ID.TJW -> TYPE_USECASE_ID_TJW.warningContent
ObuConstants.USE_CASE_ID.IVP -> TYPE_USECASE_ID_IVP.warningContent
TYPE_USECASE_ID_IVP_GREEN.useCaseId -> TYPE_USECASE_ID_IVP_GREEN.warningContent
ObuConstants.USE_CASE_ID.COC -> TYPE_USECASE_ID_COC.warningContent
TYPE_USECASE_ID_ROAD_TRAMCAR.useCaseId -> TYPE_USECASE_ID_ROAD_TRAMCAR.warningContent
TYPE_USECASE_ID_ROAD_TURN_LEFT_SHARP.useCaseId -> TYPE_USECASE_ID_ROAD_TURN_LEFT_SHARP.warningContent
TYPE_USECASE_ID_ROAD_TURN_RIGHT_SHARP.useCaseId -> TYPE_USECASE_ID_ROAD_TURN_RIGHT_SHARP.warningContent
TYPE_USECASE_ID_ROAD_PEDESTRIAN_CROSSING.useCaseId -> TYPE_USECASE_ID_ROAD_PEDESTRIAN_CROSSING.warningContent
TYPE_USECASE_ID_ROAD_PEDESTRIAN_SCHOOL.useCaseId -> TYPE_USECASE_ID_ROAD_PEDESTRIAN_SCHOOL.warningContent
TYPE_USECASE_ID_ROAD_COLLISION_WARNING.useCaseId -> TYPE_USECASE_ID_ROAD_COLLISION_WARNING.warningContent
TYPE_USECASE_ID_ROAD_ROUNDABOUTPNG.useCaseId -> TYPE_USECASE_ID_ROAD_ROUNDABOUTPNG.warningContent
TYPE_USECASE_ID_ROAD_TEST_SECTION.useCaseId -> TYPE_USECASE_ID_ROAD_TEST_SECTION.warningContent
TYPE_USECASE_ID_ROAD_HUMP_BRIDGE.useCaseId -> TYPE_USECASE_ID_ROAD_HUMP_BRIDGE.warningContent
TYPE_USECASE_ID_ROAD_NO_PARKING.useCaseId -> TYPE_USECASE_ID_ROAD_NO_PARKING.warningContent
TYPE_USECASE_ID_ROAD_GIVE_WAY.useCaseId -> TYPE_USECASE_ID_ROAD_GIVE_WAY.warningContent
ObuConstants.USE_CASE_ID.ERROR -> TYPE_ERROR.warningContent
else -> TYPE_USECASE_ID_AVW.warningContent
}
}
fun getWarningTts(useCaseId: Int): String {
return when (useCaseId) {
ObuConstants.USE_CASE_ID.EBW -> TYPE_USECASE_ID_EBW.warningTts
ObuConstants.USE_CASE_ID.FCW -> TYPE_USECASE_ID_FCW.warningTts
ObuConstants.USE_CASE_ID.ICW -> TYPE_USECASE_ID_ICW.warningTts
ObuConstants.USE_CASE_ID.CLW -> TYPE_USECASE_ID_CLW.warningTts
ObuConstants.USE_CASE_ID.DNPW -> TYPE_USECASE_ID_DNPW.warningTts
ObuConstants.USE_CASE_ID.AVW -> TYPE_USECASE_ID_AVW.warningTts
ObuConstants.USE_CASE_ID.BSW -> TYPE_USECASE_ID_BSW.warningTts
ObuConstants.USE_CASE_ID.LCW -> TYPE_USECASE_ID_LCW.warningTts
ObuConstants.USE_CASE_ID.EVW -> TYPE_USECASE_ID_EVW.warningTts
TYPE_USECASE_ID_VRUCW_PERSON.useCaseId -> TYPE_USECASE_ID_VRUCW_PERSON.warningTts
TYPE_USECASE_ID_VRUCW_MOTORBIKE.useCaseId -> TYPE_USECASE_ID_VRUCW_MOTORBIKE.warningTts
ObuConstants.USE_CASE_ID.SLW -> TYPE_USECASE_ID_SLW.warningTts
ObuConstants.USE_CASE_ID.LTA -> TYPE_USECASE_ID_LTA.warningTts
ObuConstants.USE_CASE_ID.HLW -> TYPE_USECASE_ID_HLW.warningTts
ObuConstants.USE_CASE_ID.IVS -> TYPE_USECASE_ID_IVS.warningTts
ObuConstants.USE_CASE_ID.TJW -> TYPE_USECASE_ID_TJW.warningTts
ObuConstants.USE_CASE_ID.IVP -> TYPE_USECASE_ID_IVP.warningTts
TYPE_USECASE_ID_IVP_GREEN.useCaseId -> TYPE_USECASE_ID_IVP_GREEN.warningTts
ObuConstants.USE_CASE_ID.COC -> TYPE_USECASE_ID_COC.warningTts
TYPE_USECASE_ID_ROAD_TRAMCAR.useCaseId -> TYPE_USECASE_ID_ROAD_TRAMCAR.warningTts
TYPE_USECASE_ID_ROAD_TURN_LEFT_SHARP.useCaseId -> TYPE_USECASE_ID_ROAD_TURN_LEFT_SHARP.warningTts
TYPE_USECASE_ID_ROAD_TURN_RIGHT_SHARP.useCaseId -> TYPE_USECASE_ID_ROAD_TURN_RIGHT_SHARP.warningTts
TYPE_USECASE_ID_ROAD_PEDESTRIAN_CROSSING.useCaseId -> TYPE_USECASE_ID_ROAD_PEDESTRIAN_CROSSING.warningTts
TYPE_USECASE_ID_ROAD_PEDESTRIAN_SCHOOL.useCaseId -> TYPE_USECASE_ID_ROAD_PEDESTRIAN_SCHOOL.warningTts
TYPE_USECASE_ID_ROAD_COLLISION_WARNING.useCaseId -> TYPE_USECASE_ID_ROAD_COLLISION_WARNING.warningTts
TYPE_USECASE_ID_ROAD_ROUNDABOUTPNG.useCaseId -> TYPE_USECASE_ID_ROAD_ROUNDABOUTPNG.warningTts
TYPE_USECASE_ID_ROAD_TEST_SECTION.useCaseId -> TYPE_USECASE_ID_ROAD_TEST_SECTION.warningTts
TYPE_USECASE_ID_ROAD_HUMP_BRIDGE.useCaseId -> TYPE_USECASE_ID_ROAD_HUMP_BRIDGE.warningTts
TYPE_USECASE_ID_ROAD_NO_PARKING.useCaseId -> TYPE_USECASE_ID_ROAD_NO_PARKING.warningTts
TYPE_USECASE_ID_ROAD_GIVE_WAY.useCaseId -> TYPE_USECASE_ID_ROAD_GIVE_WAY.warningTts
ObuConstants.USE_CASE_ID.ERROR -> TYPE_ERROR.warningTts
else -> TYPE_USECASE_ID_AVW.warningTts
}
}
}
}

View File

@@ -4,7 +4,7 @@ import android.content.Context;
import android.util.ArrayMap;
import com.mogo.module.common.R;
import com.mogo.module.common.entity.MarkerPoiTypeEnum;
import com.mogo.module.common.enums.EventTypeEnum;
import com.mogo.module.common.marker.PoiWrapper;
import com.mogo.utils.logger.Logger;
import com.mogo.utils.network.utils.GsonUtil;
@@ -37,47 +37,47 @@ public class CloudPoiManager {
public void generateDefault() {
if (poiWrapper.isEmpty()) {
poiWrapper.put(MarkerPoiTypeEnum.GAS_STATION, new PoiWrapper(MarkerPoiTypeEnum.GAS_STATION, R.drawable.module_common_icon_map_marker_refuel,
poiWrapper.put(EventTypeEnum.GAS_STATION.getPoiType(), new PoiWrapper(EventTypeEnum.GAS_STATION.getPoiType(), R.drawable.module_common_icon_map_marker_refuel,
R.drawable.module_common_icon_map_marker_refuel, "加油站"));
poiWrapper.put(MarkerPoiTypeEnum.TRAFFIC_CHECK, new PoiWrapper(MarkerPoiTypeEnum.TRAFFIC_CHECK,
poiWrapper.put(EventTypeEnum.TRAFFIC_CHECK.getPoiType(), new PoiWrapper(EventTypeEnum.TRAFFIC_CHECK.getPoiType(),
R.drawable.module_common_icon_map_marker_road_check2, R.drawable.module_common_icon_map_marker_road_check2_white, "交通检查"));
poiWrapper.put(MarkerPoiTypeEnum.ROAD_CLOSED, new PoiWrapper(MarkerPoiTypeEnum.ROAD_CLOSED,
poiWrapper.put(EventTypeEnum.ROAD_CLOSED.getPoiType(), new PoiWrapper(EventTypeEnum.ROAD_CLOSED.getPoiType(),
R.drawable.module_common_icon_map_marker_road_block_off2, R.drawable.module_common_icon_map_marker_road_block_off2_white, "封路"));
poiWrapper.put(MarkerPoiTypeEnum.SHOP_DISCOUNT, new PoiWrapper(MarkerPoiTypeEnum.SHOP_DISCOUNT,
poiWrapper.put(EventTypeEnum.SHOP_DISCOUNT.getPoiType(), new PoiWrapper(EventTypeEnum.SHOP_DISCOUNT.getPoiType(),
R.drawable.module_common_icon_map_marker_shop_discount, R.drawable.module_common_icon_map_marker_shop_discount, "商场打折"));
poiWrapper.put(MarkerPoiTypeEnum.FOURS_4S, new PoiWrapper(MarkerPoiTypeEnum.FOURS_4S,
poiWrapper.put(EventTypeEnum.FOURS_4S.getPoiType(), new PoiWrapper(EventTypeEnum.FOURS_4S.getPoiType(),
R.drawable.module_common_icon_map_marker_4s, R.drawable.module_common_icon_map_marker_4s, "4S店"));
poiWrapper.put(MarkerPoiTypeEnum.FOURS_ROAD_WORK, new PoiWrapper(MarkerPoiTypeEnum.FOURS_ROAD_WORK,
poiWrapper.put(EventTypeEnum.FOURS_ROAD_WORK.getPoiType(), new PoiWrapper(EventTypeEnum.FOURS_ROAD_WORK.getPoiType(),
R.drawable.module_common_icon_map_marker_road_work2, R.drawable.module_common_icon_map_marker_road_work2_white, "施工"));
poiWrapper.put(MarkerPoiTypeEnum.FOURS_BLOCK_UP, new PoiWrapper(MarkerPoiTypeEnum.FOURS_BLOCK_UP,
poiWrapper.put(EventTypeEnum.FOURS_BLOCK_UP.getPoiType(), new PoiWrapper(EventTypeEnum.FOURS_BLOCK_UP.getPoiType(),
R.drawable.module_common_icon_map_marker_road_block_up2, R.drawable.module_common_icon_map_marker_road_block_up2_white, "拥堵"));
poiWrapper.put(MarkerPoiTypeEnum.FOURS_PONDING, new PoiWrapper(MarkerPoiTypeEnum.FOURS_PONDING,
poiWrapper.put(EventTypeEnum.FOURS_PONDING.getPoiType(), new PoiWrapper(EventTypeEnum.FOURS_PONDING.getPoiType(),
R.drawable.module_common_icon_map_marker_pondingl2, R.drawable.module_common_icon_map_marker_pondingl2_white, "积水"));
poiWrapper.put(MarkerPoiTypeEnum.FOURS_SHOP_FREE, new PoiWrapper(MarkerPoiTypeEnum.FOURS_SHOP_FREE,
poiWrapper.put(EventTypeEnum.FOURS_SHOP_FREE.getPoiType(), new PoiWrapper(EventTypeEnum.FOURS_SHOP_FREE.getPoiType(),
R.drawable.module_common_icon_map_marker_shop, R.drawable.module_common_icon_map_marker_shop, "超时打折"));
poiWrapper.put(MarkerPoiTypeEnum.FOURS_FOG, new PoiWrapper(MarkerPoiTypeEnum.FOURS_FOG,
poiWrapper.put(EventTypeEnum.FOURS_FOG.getPoiType(), new PoiWrapper(EventTypeEnum.FOURS_FOG.getPoiType(),
R.drawable.module_common_ic_rc_dark_frog2, R.drawable.module_common_ic_rc_dark_frog2_white, "浓雾"));
poiWrapper.put(MarkerPoiTypeEnum.FOURS_ICE, new PoiWrapper(MarkerPoiTypeEnum.FOURS_ICE,
poiWrapper.put(EventTypeEnum.FOURS_ICE.getPoiType(), new PoiWrapper(EventTypeEnum.FOURS_ICE.getPoiType(),
R.drawable.module_common_ic_rc_freeze2, R.drawable.module_common_ic_rc_freeze2_white, "结冰"));
poiWrapper.put(MarkerPoiTypeEnum.FOURS_PARKING, new PoiWrapper(MarkerPoiTypeEnum.FOURS_PARKING,
poiWrapper.put(EventTypeEnum.FOURS_PARKING.getPoiType(), new PoiWrapper(EventTypeEnum.FOURS_PARKING.getPoiType(),
R.drawable.module_common_ic_rc_parking2, R.drawable.module_common_ic_rc_parking2, "停车场"));
poiWrapper.put(MarkerPoiTypeEnum.FOURS_ACCIDENT, new PoiWrapper(MarkerPoiTypeEnum.FOURS_ACCIDENT,
poiWrapper.put(EventTypeEnum.FOURS_ACCIDENT.getPoiType(), new PoiWrapper(EventTypeEnum.FOURS_ACCIDENT.getPoiType(),
R.drawable.module_common_ic_rc_accident3, R.drawable.module_common_ic_rc_accident3_white, "事故"));
poiWrapper.put(MarkerPoiTypeEnum.FOURS_ACCIDENT_01, new PoiWrapper(MarkerPoiTypeEnum.FOURS_ACCIDENT_01,
poiWrapper.put(EventTypeEnum.FOURS_ACCIDENT_01.getPoiType(), new PoiWrapper(EventTypeEnum.FOURS_ACCIDENT_01.getPoiType(),
R.drawable.module_common_ic_rc_accident3, R.drawable.module_common_ic_rc_accident3_white, "重大事故"));
poiWrapper.put(MarkerPoiTypeEnum.FOURS_ACCIDENT_02, new PoiWrapper(MarkerPoiTypeEnum.FOURS_ACCIDENT_02,
poiWrapper.put(EventTypeEnum.FOURS_ACCIDENT_02.getPoiType(), new PoiWrapper(EventTypeEnum.FOURS_ACCIDENT_02.getPoiType(),
R.drawable.module_common_ic_rc_accident3, R.drawable.module_common_ic_rc_accident3_white, "特大事故"));
poiWrapper.put(MarkerPoiTypeEnum.FOURS_ACCIDENT_03, new PoiWrapper(MarkerPoiTypeEnum.FOURS_ACCIDENT_03,
poiWrapper.put(EventTypeEnum.FOURS_ACCIDENT_03.getPoiType(), new PoiWrapper(EventTypeEnum.FOURS_ACCIDENT_03.getPoiType(),
R.drawable.module_common_ic_rc_accident3, R.drawable.module_common_ic_rc_accident3_white, "较大事故"));
poiWrapper.put(MarkerPoiTypeEnum.FOURS_ACCIDENT_04, new PoiWrapper(MarkerPoiTypeEnum.FOURS_ACCIDENT_04,
poiWrapper.put(EventTypeEnum.FOURS_ACCIDENT_04.getPoiType(), new PoiWrapper(EventTypeEnum.FOURS_ACCIDENT_04.getPoiType(),
R.drawable.module_common_ic_rc_accident3, R.drawable.module_common_ic_rc_accident3_white, "一般事故"));
poiWrapper.put(MarkerPoiTypeEnum.FOURS_ACCIDENT_05, new PoiWrapper(MarkerPoiTypeEnum.FOURS_ACCIDENT_05,
poiWrapper.put(EventTypeEnum.FOURS_ACCIDENT_05.getPoiType(), new PoiWrapper(EventTypeEnum.FOURS_ACCIDENT_05.getPoiType(),
R.drawable.module_common_ic_rc_accident3, R.drawable.module_common_ic_rc_accident3_white, "轻微事故"));
poiWrapper.put(MarkerPoiTypeEnum.FOURS_NEALY, new PoiWrapper(MarkerPoiTypeEnum.FOURS_NEALY,
poiWrapper.put(EventTypeEnum.FOURS_NEALY.getPoiType(), new PoiWrapper(EventTypeEnum.FOURS_NEALY.getPoiType(),
R.drawable.module_common_icon_map_marker_shear_news, R.drawable.module_common_icon_map_marker_shear_news, "身边"));
poiWrapper.put(MarkerPoiTypeEnum.FOURS_LIVING, new PoiWrapper(MarkerPoiTypeEnum.FOURS_LIVING,
poiWrapper.put(EventTypeEnum.FOURS_LIVING.getPoiType(), new PoiWrapper(EventTypeEnum.FOURS_LIVING.getPoiType(),
R.drawable.module_common_icon_map_marker_living, R.drawable.module_common_icon_map_marker_living_white, "实时路况"));
poiWrapper.put(MarkerPoiTypeEnum.ILLEGAL_PARK_LIVING, new PoiWrapper(MarkerPoiTypeEnum.ILLEGAL_PARK_LIVING,
poiWrapper.put(EventTypeEnum.ILLEGAL_PARK_LIVING.getPoiType(), new PoiWrapper(EventTypeEnum.ILLEGAL_PARK_LIVING.getPoiType(),
R.drawable.module_common_ic_rc_illegal_park, R.drawable.module_common_ic_rc_illegal_park_white, "违章停车"));
// 分享里用到的故障求助
poiWrapper.put("9999", new PoiWrapper("9999",

View File

@@ -7,4 +7,37 @@ public class Const {
public static final String BROADCAST_SCENE_HANDLER_ACTION = "com.v2x.scene_handler_broadcast";
public static final String BROADCAST_SCENE_EXTRA_KEY = "V2XMessageEntity";
/**
* 用户UGC反馈免唤醒词语
*/
// 拥堵
public static final String COMMAND_ZHIDAO_V2X_FEEDBACK_YONG_DU_YES_UN_WAKEUP = "COMMAND_ZHIDAO_V2X_FEEDBACK_YONG_DU_YES_UN_WAKEUP";
public static final String[] COMMAND_ZHIDAO_V2X_FEEDBACK_YONG_DU_YES_UN_WAKEUP_WORDS = {"拥堵", "很堵", "堵死了", "有点堵", "确定"};
public static final String COMMAND_ZHIDAO_V2X_FEEDBACK_YONG_DU_NO_UN_WAKEUP = "COMMAND_ZHIDAO_V2X_FEEDBACK_YONG_DU_NO_UN_WAKEUP";
public static final String[] COMMAND_ZHIDAO_V2X_FEEDBACK_YONG_DU_NO_UN_WAKEUP_WORDS = {"没注意", "不堵", "很畅通", "取消", "关闭"};
// 封路
public static final String COMMAND_ZHIDAO_V2X_FEEDBACK_FENG_LU_YES_UN_WAKEUP = "COMMAND_ZHIDAO_V2X_FEEDBACK_FENG_LU_YES_UN_WAKEUP";
public static final String[] COMMAND_ZHIDAO_V2X_FEEDBACK_FENG_LU_YES_UN_WAKEUP_WORDS = {"封路了", "封了", "封路", "有封路", "确定"};
public static final String COMMAND_ZHIDAO_V2X_FEEDBACK_FENG_LU_NO_UN_WAKEUP = "COMMAND_ZHIDAO_V2X_FEEDBACK_FENG_LU_NO_UN_WAKEUP";
public static final String[] COMMAND_ZHIDAO_V2X_FEEDBACK_FENG_LU_NO_UN_WAKEUP_WORDS = {"不封路", "没注意", "没看到", "没有", "没封路", "无封路", "取消", "关闭"};
// 事故
public static final String COMMAND_ZHIDAO_V2X_FEEDBACK_SHI_GU_YES_UN_WAKEUP = "COMMAND_ZHIDAO_V2X_FEEDBACK_SHI_GU_YES_UN_WAKEUP";
public static final String[] COMMAND_ZHIDAO_V2X_FEEDBACK_SHI_GU_YES_UN_WAKEUP_WORDS = {"有事故", "存在交通事故", "确定"};
public static final String COMMAND_ZHIDAO_V2X_FEEDBACK_SHI_GU_NO_UN_WAKEUP = "COMMAND_ZHIDAO_V2X_FEEDBACK_SHI_GU_NO_UN_WAKEUP";
public static final String[] COMMAND_ZHIDAO_V2X_FEEDBACK_SHI_GU_NO_UN_WAKEUP_WORDS = {"没注意", "没有事故", "无事故", "没看到", "没有", "取消", "关闭"};
// 道路施工
public static final String COMMAND_ZHIDAO_V2X_FEEDBACK_SHI_GONG_YES_UN_WAKEUP = "COMMAND_ZHIDAO_V2X_FEEDBACK_SHI_GONG_YES_UN_WAKEUP";
public static final String[] COMMAND_ZHIDAO_V2X_FEEDBACK_SHI_GONG_YES_UN_WAKEUP_WORDS = {"", "在施工", "有施工", "确定"};
public static final String COMMAND_ZHIDAO_V2X_FEEDBACK_SHI_GONG_NO_UN_WAKEUP = "COMMAND_ZHIDAO_V2X_FEEDBACK_SHI_GONG_NO_UN_WAKEUP";
public static final String[] COMMAND_ZHIDAO_V2X_FEEDBACK_SHI_GONG_NO_UN_WAKEUP_WORDS = {"没注意", "没看到", "没有施工", "无施工", "很正常", "取消", "关闭"};
}

View File

@@ -0,0 +1,55 @@
package com.mogo.module.common.view;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Rect;
import android.util.AttributeSet;
import androidx.appcompat.widget.AppCompatImageView;
/**
* @author donghongyu
* @date 2019-08-22
*/
public class ImageViewClipBounds extends AppCompatImageView {
Rect mClipBounds = null;
public ImageViewClipBounds(Context context) {
this(context, null);
}
public ImageViewClipBounds(Context context, AttributeSet attrs) {
this(context, attrs, 0);
}
public ImageViewClipBounds(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
}
@Override
protected void onDraw(Canvas canvas) {
if (mClipBounds != null) {
// clip bounds ignore scroll
canvas.clipRect(mClipBounds);
}
super.onDraw(canvas);
}
public void setClip(Rect clipBounds) {
if (clipBounds == mClipBounds || (clipBounds != null && clipBounds.equals(mClipBounds))) {
return;
}
if (clipBounds != null) {
if (mClipBounds == null) {
mClipBounds = new Rect(clipBounds);
} else {
mClipBounds.set(clipBounds);
}
} else {
mClipBounds = null;
}
invalidate();
}
}

View File

@@ -1,4 +1,4 @@
package com.mogo.module.v2x.fragment;
package com.mogo.module.common.view;
import android.content.Context;
import android.util.AttributeSet;
@@ -7,16 +7,16 @@ import android.util.Log;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
class V2XLinearLayoutManager extends LinearLayoutManager {
public V2XLinearLayoutManager(Context context) {
public class LinearLayoutCommonManager extends LinearLayoutManager {
public LinearLayoutCommonManager(Context context) {
super(context);
}
public V2XLinearLayoutManager(Context context, int orientation, boolean reverseLayout) {
public LinearLayoutCommonManager(Context context, int orientation, boolean reverseLayout) {
super(context, orientation, reverseLayout);
}
public V2XLinearLayoutManager(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
public LinearLayoutCommonManager(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
super(context, attrs, defStyleAttr, defStyleRes);
}

View File

@@ -1,4 +1,4 @@
package com.mogo.module.v2x;
package com.mogo.module.common.view;
import android.graphics.Rect;
import android.view.View;

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

View File

Before

Width:  |  Height:  |  Size: 2.0 KiB

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Some files were not shown because too many files have changed in this diff Show More