Merge branch 'dev_robotaxi-d-app-module_2130_221116_2.13.0' into mutidev_robotaxi-d-app-module_2130_221116_2.13.0_multi_display

# Conflicts:
#	core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/main/MainLauncherActivity.java
This commit is contained in:
donghongyu
2022-11-29 18:06:42 +08:00
44 changed files with 1223 additions and 820 deletions

View File

@@ -848,8 +848,8 @@ public class BusOrderModel {
removeTipRunnables();
long taskTime = busRoutesResult.getTaskTime();
long tip3Time = taskTime-3000 - DateTimeUtil.getCurrentTimeStamp(); // 首站离开前3分钟提示
long tip1Time = taskTime-1000 - DateTimeUtil.getCurrentTimeStamp(); // 首站离开前1分钟提示
long tip3Time = taskTime- 3*60*1000 - DateTimeUtil.getCurrentTimeStamp(); // 首站离开前3分钟提示
long tip1Time = taskTime-60*1000 - DateTimeUtil.getCurrentTimeStamp(); // 首站离开前1分钟提示
if (tip3Time > 0){
UiThreadHandler.postDelayed(tip3Runnable,tip3Time);

View File

@@ -205,7 +205,7 @@ class HttpDnsStartUp : AndroidStartup<Boolean>() {
clientConfig.token = token
// 由于存在token过期问题在更新后会回调至此处增加二次判定
if(!gotToken){
CallerLogger.d(SceneConstant.M_MAP + TAG, "onTokenGot ")
CallerLogger.d(SceneConstant.M_MAIN + TAG, "onTokenGot ")
CallerCloudListenerManager.invokeCloudTokenGot(token)
// 异步初始化NetConfig
asyncInit()
@@ -219,7 +219,7 @@ class HttpDnsStartUp : AndroidStartup<Boolean>() {
override fun onError(code: Int, msg: String) {
CallerLogger.d(
SceneConstant.M_HMI + TAG,
SceneConstant.M_MAIN + TAG,
"初始化MogoAiCloudSdk failed ,reason : $msg , 未能开启长链服务和初始化Modules服务"
)
}
@@ -272,7 +272,7 @@ class HttpDnsStartUp : AndroidStartup<Boolean>() {
HttpDnsConst.HTTP_DNS_ADDRESS_TYPE_HTTP
) ?: return
if (dnsCacheIp != cacheIp) {
CallerLogger.d("TEST_SOCKET", "获取缓存Dns IP : $dnsCacheIp , 原缓存 IP $cacheIp")
CallerLogger.d(SceneConstant.M_MAIN + TAG, "获取缓存Dns IP : $dnsCacheIp , 原缓存 IP $cacheIp")
startSocketService()
cacheIp = dnsCacheIp
}
@@ -297,7 +297,7 @@ class HttpDnsStartUp : AndroidStartup<Boolean>() {
}
private fun startSocketService() {
CallerLogger.d(SceneConstant.M_HMI + TAG, "startSocketService")
CallerLogger.d(SceneConstant.M_MAIN + TAG, "startSocketService")
val location =
CallerMapUIServiceManager.getSingletonLocationClient(AbsMogoApplication.getApp())!!
.lastKnowLocation
@@ -315,7 +315,7 @@ class HttpDnsStartUp : AndroidStartup<Boolean>() {
clientPkFileName = "sn"
)
override fun onConnectFailure() {
CallerLogger.d(SceneConstant.M_HMI + TAG, "socket-onConnectFailure")
CallerLogger.d(SceneConstant.M_MAIN + TAG, "socket-onConnectFailure")
DebugConfig.setDownloadSnapshot(false)
}
@@ -328,7 +328,7 @@ class HttpDnsStartUp : AndroidStartup<Boolean>() {
clientPkFileName = "sn"
)
override fun onConnectSuccess() {
CallerLogger.d(SceneConstant.M_HMI + TAG, "socket-onConnectSuccess")
CallerLogger.d(SceneConstant.M_MAIN + TAG, "socket-onConnectSuccess")
DebugConfig.setDownloadSnapshot(true)
}
@@ -341,7 +341,7 @@ class HttpDnsStartUp : AndroidStartup<Boolean>() {
clientPkFileName = "sn"
)
override fun onConnectLost() {
CallerLogger.d(SceneConstant.M_HMI + TAG, "socket-onConnectLost")
CallerLogger.d(SceneConstant.M_MAIN + TAG, "socket-onConnectLost")
DebugConfig.setDownloadSnapshot(false)
}
@@ -354,7 +354,7 @@ class HttpDnsStartUp : AndroidStartup<Boolean>() {
clientPkFileName = "sn"
)
override fun onError(code: String, msg: String?) {
CallerLogger.d(SceneConstant.M_HMI + TAG, "socket-onConnectLost")
CallerLogger.d(SceneConstant.M_MAIN + TAG, "socket-onError code : $code , msg : $msg")
}
})
// 开启Socket长链服务

View File

@@ -86,11 +86,12 @@ dependencies {
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
implementation rootProject.ext.dependencies.gson
implementation project(':libraries:mogo-adas')
implementation project(':libraries:mogo-adas-data')
implementation project(':libraries:mogo-adas-other')
// implementation 'com.zhidao.support.adas:high:2.8.0.0'
// implementation 'com.zhjt.mogo.adas.data:adas-data:2.6.6.0'
compileOnly project(':core:mogo-core-data')
implementation project(':core:mogo-core-utils')
// compileOnly project(':core:mogo-core-data')
// implementation project(':core:mogo-core-utils')
implementation 'org.greenrobot:eventbus:3.2.0'
implementation 'com.android.support:multidex:1.0.3'
implementation 'com.mogo.cloud:telematic:1.3.59'

View File

@@ -1,7 +1,6 @@
package com.zhidao.adas.client.ui;
import android.app.Activity;
import android.content.Context;
import android.graphics.PixelFormat;
import android.util.DisplayMetrics;
import android.view.Gravity;
@@ -12,14 +11,12 @@ import android.view.WindowManager;
import androidx.recyclerview.widget.RecyclerView;
import com.mogo.eagle.core.utilcode.util.BarUtils;
import com.zhidao.adas.client.R;
import com.zhidao.adas.client.adapter.ConnectStatusAdapter;
import com.zhidao.adas.client.adapter.DataShowAdapter;
import com.zhidao.adas.client.bean.IPCConnectState;
import com.zhidao.adas.client.utils.MyLinearLayoutManager;
import com.zhidao.adas.client.utils.SysBarUtil;
import java.lang.reflect.Field;
import java.util.List;
/**
@@ -49,8 +46,9 @@ public class FloatWindow implements View.OnTouchListener {
this.list = list;
initFloatWindow();
}
public void refreshView(){
if (adapter!=null){
public void refreshView() {
if (adapter != null) {
adapter.refreshView();
}
}
@@ -109,14 +107,14 @@ public class FloatWindow implements View.OnTouchListener {
mInViewY = motionEvent.getY();
// 获取相对屏幕的坐标,即以屏幕左上角为原点
mDownInScreenX = motionEvent.getRawX();
mDownInScreenY = motionEvent.getRawY() - BarUtils.getStatusBarHeight();
mDownInScreenY = motionEvent.getRawY() - SysBarUtil.getSysBarHeight(mContext);
mInScreenX = motionEvent.getRawX();
mInScreenY = motionEvent.getRawY() - BarUtils.getStatusBarHeight();
mInScreenY = motionEvent.getRawY() - SysBarUtil.getSysBarHeight(mContext);
break;
case MotionEvent.ACTION_MOVE:
// 更新浮动窗口位置参数
mInScreenX = motionEvent.getRawX();
mInScreenY = motionEvent.getRawY() - BarUtils.getStatusBarHeight();
mInScreenY = motionEvent.getRawY() - SysBarUtil.getSysBarHeight(mContext);
mWindowParams.x = (int) (mInScreenX - mInViewX);
mWindowParams.y = (int) (mInScreenY - mInViewY);
// 手指移动的时候更新小悬浮窗的位置
@@ -156,6 +154,5 @@ public class FloatWindow implements View.OnTouchListener {
mFloatLayout.setAlpha(1);
}
private int sbar = -1;
}

View File

@@ -22,13 +22,12 @@ import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.appcompat.widget.AppCompatButton;
import com.mogo.eagle.core.utilcode.util.BarUtils;
import com.zhidao.adas.client.R;
import com.zhidao.adas.client.bean.SpecialVehicleBean;
import com.zhidao.adas.client.bean.SpecialVehicleOption;
import com.zhidao.adas.client.utils.SysBarUtil;
import java.lang.ref.WeakReference;
import java.lang.reflect.Field;
/**
@@ -130,9 +129,9 @@ public class SpecialVehicleFloatWindow extends LinearLayout {
mInViewY = event.getY();
// 获取相对屏幕的坐标,即以屏幕左上角为原点
mDownInScreenX = event.getRawX();
mDownInScreenY = event.getRawY() - BarUtils.getStatusBarHeight();
mDownInScreenY = event.getRawY() - SysBarUtil.getSysBarHeight(getContext());
mInScreenX = event.getRawX();
mInScreenY = event.getRawY() - BarUtils.getStatusBarHeight();
mInScreenY = event.getRawY() - SysBarUtil.getSysBarHeight(getContext());
if (!isMaximize) {
btn_maximize.setPressed(true);
@@ -143,7 +142,7 @@ public class SpecialVehicleFloatWindow extends LinearLayout {
case MotionEvent.ACTION_MOVE:
// 更新浮动窗口位置参数
mInScreenX = event.getRawX();
mInScreenY = event.getRawY() - BarUtils.getStatusBarHeight();
mInScreenY = event.getRawY() - SysBarUtil.getSysBarHeight(getContext());
wmParams.x = (int) (mInScreenX - mInViewX);
wmParams.y = (int) (mInScreenY - mInViewY);
updateViewLayout();
@@ -197,7 +196,6 @@ public class SpecialVehicleFloatWindow extends LinearLayout {
private int sbar = -1;
/*****************************业务逻辑*******************************************/

View File

@@ -0,0 +1,30 @@
package com.zhidao.adas.client.utils;
import android.content.Context;
import java.lang.reflect.Field;
public class SysBarUtil {
private static int sbar = -1;
// 获取系统状态栏高度
public static int getSysBarHeight(Context contex) {
if (sbar == -1) {
Class<?> c;
Object obj;
Field field;
int x;
sbar = 0;
try {
c = Class.forName("com.android.internal.R$dimen");
obj = c.newInstance();
field = c.getField("status_bar_height");
x = Integer.parseInt(field.get(obj).toString());
sbar = contex.getResources().getDimensionPixelSize(x);
} catch (Exception e1) {
e1.printStackTrace();
}
}
return sbar;
}
}

View File

@@ -65,8 +65,9 @@ dependencies {
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
implementation rootProject.ext.dependencies.gson
implementation project(':libraries:mogo-adas')
compileOnly project(':core:mogo-core-data')
implementation project(':core:mogo-core-utils')
implementation project(':libraries:mogo-adas-data')
// compileOnly project(':core:mogo-core-data')
// implementation project(':core:mogo-core-utils')
implementation 'org.greenrobot:eventbus:3.2.0'
implementation 'com.android.support:multidex:1.0.3'
}

View File

@@ -1,7 +1,6 @@
package com.zhidao.adas.magic.ui;
import android.app.Activity;
import android.content.Context;
import android.graphics.PixelFormat;
import android.util.DisplayMetrics;
import android.view.Gravity;
@@ -12,13 +11,12 @@ import android.view.WindowManager;
import androidx.recyclerview.widget.RecyclerView;
import com.mogo.eagle.core.utilcode.util.BarUtils;
import com.zhidao.adas.magic.R;
import com.zhidao.adas.magic.adapter.ConnectStatusAdapter;
import com.zhidao.adas.magic.bean.IPCConnectState;
import com.zhidao.adas.magic.utils.MyLinearLayoutManager;
import com.zhidao.adas.magic.utils.SysBarUtil;
import java.lang.reflect.Field;
import java.util.List;
/**
@@ -109,14 +107,14 @@ public class FloatWindow implements View.OnTouchListener {
mInViewY = motionEvent.getY();
// 获取相对屏幕的坐标,即以屏幕左上角为原点
mDownInScreenX = motionEvent.getRawX();
mDownInScreenY = motionEvent.getRawY() - BarUtils.getStatusBarHeight();
mDownInScreenY = motionEvent.getRawY() - SysBarUtil.getSysBarHeight(mContext);
mInScreenX = motionEvent.getRawX();
mInScreenY = motionEvent.getRawY() - BarUtils.getStatusBarHeight();
mInScreenY = motionEvent.getRawY() - SysBarUtil.getSysBarHeight(mContext);
break;
case MotionEvent.ACTION_MOVE:
// 更新浮动窗口位置参数
mInScreenX = motionEvent.getRawX();
mInScreenY = motionEvent.getRawY() - BarUtils.getStatusBarHeight();
mInScreenY = motionEvent.getRawY() - SysBarUtil.getSysBarHeight(mContext);
mWindowParams.x = (int) (mInScreenX - mInViewX);
mWindowParams.y = (int) (mInScreenY - mInViewY);
// 手指移动的时候更新小悬浮窗的位置

View File

@@ -33,7 +33,6 @@ import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import androidx.recyclerview.widget.SimpleItemAnimator;
import com.mogo.eagle.core.utilcode.util.ToastUtils;
import com.zhidao.adas.magic.R;
import com.zhidao.adas.magic.adapter.InfoTitleAdapter;
import com.zhidao.adas.magic.base.BaseActivity;

View File

@@ -0,0 +1,30 @@
package com.zhidao.adas.magic.utils;
import android.content.Context;
import java.lang.reflect.Field;
public class SysBarUtil {
private static int sbar = -1;
// 获取系统状态栏高度
public static int getSysBarHeight(Context contex) {
if (sbar == -1) {
Class<?> c;
Object obj;
Field field;
int x;
sbar = 0;
try {
c = Class.forName("com.android.internal.R$dimen");
obj = c.newInstance();
field = c.getField("status_bar_height");
x = Integer.parseInt(field.get(obj).toString());
sbar = contex.getResources().getDimensionPixelSize(x);
} catch (Exception e1) {
e1.printStackTrace();
}
}
return sbar;
}
}

View File

@@ -97,7 +97,7 @@ ext {
// obu sdk
obusdk : "com.zhidao.enterprise.smartv2x:smartv2x:1.0.0.3",
mogoobuold : 'com.zhidao.support.obu:mogoobu:1.0.0.33',
mogoobu : 'com.mogo.support.obu:mogo-obu:1.0.3',
mogoobu : 'com.mogo.support.obu:mogo-obu:1.0.4',
mogoami : 'com.zhidao.support.obu.ami:mogoami:1.0.0.24',
// google

View File

@@ -570,10 +570,11 @@ class DebugSettingView @JvmOverloads constructor(
}
}
Log.i(
"1026-emArrow",
"debug setting FunctionBuildConfig.isDemoMode : ${FunctionBuildConfig.isDemoMode}"
)
btnDrawFusion.isChecked = FunctionBuildConfig.isFusionColor
btnDrawFusion.setOnCheckedChangeListener{_, isChecked ->
FunctionBuildConfig.isFusionColor = isChecked
}
// 演示模式,上一次勾选的数据
tbIsDemoMode.isChecked = FunctionBuildConfig.isDemoMode

View File

@@ -4,6 +4,7 @@ import android.content.Context
import android.util.AttributeSet
import android.view.LayoutInflater
import android.view.View
import com.mogo.commons.debug.DebugConfig
import com.mogo.eagle.core.data.temp.EventLogout
import com.mogo.eagle.core.function.api.hmi.view.IOchBusView
import com.mogo.eagle.core.function.hmi.R
@@ -31,6 +32,14 @@ class BusOperationView @JvmOverloads constructor(
clickPersonalRightView();
}
private fun initPersonalIcon() {
if("fPadLenovoOchTaxi" == DebugConfig.getProductFlavor()){
ivGotoPersonalInfo.visibility = VISIBLE
}else{
ivGotoPersonalInfo.visibility = GONE
}
}
private fun clickPersonalRightView() {
ivGotoPersonalInfo.onClick {
EventBus.getDefault().post(EventLogout(EventLogout.PERSONAL_TYPE))
@@ -39,6 +48,7 @@ class BusOperationView @JvmOverloads constructor(
override fun showBusOperation() {
ochBusOperationStatus.visibility = View.VISIBLE
initPersonalIcon()
}
override fun changerOperationStatus(isOut: Boolean) {

View File

@@ -62,7 +62,7 @@ class TurnLightViewStatus @JvmOverloads constructor(
if (directionLight == 1 || directionLight == 2) {
if (!isVisualAngleChanged) {
isVisualAngleChanged = true
CallerVisualAngleManager.changeVisualAngle(Turning)
CallerVisualAngleManager.changeVisualAngle(Turning(true))
}
}
@@ -96,7 +96,7 @@ class TurnLightViewStatus @JvmOverloads constructor(
} else { //消失
if (isVisualAngleChanged) {
isVisualAngleChanged = false
CallerVisualAngleManager.changeVisualAngle(Default())
CallerVisualAngleManager.changeVisualAngle(Turning(false))
}
if (!isDisappare) {
isDisappare = true

View File

@@ -36,6 +36,7 @@ import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils;
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr;
import com.mogo.eagle.core.utilcode.util.ToastUtils;
import com.mogo.eagle.core.utilcode.util.UiThreadHandler;
import com.rousetime.android_startup.model.CostTimesModel;
import com.zhjt.service.chain.ChainLog;
import com.zhjt.service.chain.TracingConstants;
@@ -68,6 +69,20 @@ public class MainLauncherActivity extends MainActivity implements IMogoIntentLis
private BluetoothMonitorReceiver mBluetoothReceiver = null;
private BluetoothAdapter mBluetoothAdapter;
private boolean isShowToast = false; //toast 控制
private long startPressTime = 0; //开始按减时间
private boolean isPressEnd = false; //按键是否结束
private volatile int isCombinationKey = 0; //是否是组合按键 1单击2长按3组合
private long pressADownTime = 0;
private long pressAUpTime = 0;
private long pressBDownTime = 0;
private long pressBUpTime = 0;
private long pressCDownTime = 0;
private long pressCUpTime = 0;
private long pressDDownTime = 0;
private long pressDUpTime = 0;
private long pressEDownTime = 0;
private long pressEUpTime = 0;
@Override
@@ -225,24 +240,8 @@ public class MainLauncherActivity extends MainActivity implements IMogoIntentLis
return super.onKeyDown(keyCode, event);
}
private long startPressTime = 0; //开始按减时间
private boolean isPressEnd = false; //按键是否结束
private boolean isCombinationKey = false; //是否是组合按键
private long pressADownTime = 0;
private long pressAUpTime = 0;
private long pressBDownTime = 0;
private long pressBUpTime = 0;
private long pressCDownTime = 0;
private long pressCUpTime = 0;
private long pressDDownTime = 0;
private long pressDUpTime = 0;
private long pressEDownTime = 0;
private long pressEUpTime = 0;
/**
* 魔方按键分发 提测前注释 ToastUtils TODO
* 魔方按键分发
*
* @param event
* @return
@@ -264,26 +263,40 @@ public class MainLauncherActivity extends MainActivity implements IMogoIntentLis
if (event.getAction() == KeyEvent.ACTION_DOWN) {
pressADownTime = System.currentTimeMillis();
Log.d(TAG, "dispatchKeyEvent A down pressADownTime = " + pressADownTime + "---" + (pressADownTime - startPressTime) + "----isCombinationKey = " + isCombinationKey + "--pressBDownTime = " + pressBDownTime);
if ((pressADownTime - startPressTime) > 320 && (pressADownTime - startPressTime) < 1600 && pressBDownTime > 0) {
ToastUtils.showShort("方块 A 按AB组合 -2 ");
if ((pressADownTime - startPressTime) > 320 && (pressADownTime - startPressTime) < 1300 && pressBDownTime > 0) {
if (isShowToast) {
ToastUtils.showShort("方块 A 按AB组合 -2 ");
}
sendAcc(true, -2);
isCombinationKey = true;
isCombinationKey = 3;
}
if (!isCombinationKey) {
if ((pressADownTime - startPressTime) > 1700) {
ToastUtils.showShort("方块 长按A 无 操作 ");
if (isCombinationKey != 3 && isCombinationKey != 1) {
if ((pressADownTime - startPressTime) > 1320) {
if (isShowToast) {
ToastUtils.showShort("方块 长按A 无 操作 ");
}
isCombinationKey = 2;
}
}
} else if (event.getAction() == KeyEvent.ACTION_UP) {
pressAUpTime = System.currentTimeMillis();
Log.e(TAG, "dispatchKeyEvent A up pressAUpTime = " + pressAUpTime + "---" + (pressAUpTime - startPressTime) + "--pressBDownTime = " + pressBDownTime);
if ((pressAUpTime - startPressTime) < 300 && !isCombinationKey) {
ToastUtils.showShort("方块 单击A -1 ");
if ((pressAUpTime - startPressTime) < 300 && isCombinationKey != 3) {
isCombinationKey = 1;
if (isShowToast) {
ToastUtils.showShort("方块 单击A -1 ");
}
sendAcc(true, -1);
}
pressADownTime = 0;
isPressEnd = false;
isCombinationKey = false;
UiThreadHandler.postDelayed(new Runnable() {
@Override
public void run() {
isCombinationKey = 0;
}
}, 300);
}
return true;
@@ -291,44 +304,59 @@ public class MainLauncherActivity extends MainActivity implements IMogoIntentLis
if (event.getAction() == KeyEvent.ACTION_DOWN) {
pressBDownTime = System.currentTimeMillis();
Log.d(TAG, "dispatchKeyEvent B down pressBDownTime = " + pressBDownTime + "--差-" + (pressBDownTime - startPressTime) + "---isCombinationKey = " + isCombinationKey + "--pressADownTime = " + pressADownTime);
if ((pressBDownTime - startPressTime) > 320 && (pressBDownTime - startPressTime) < 1600 && pressADownTime > 0) {
ToastUtils.showShort("方块 B 按AB组合 ");
if ((pressBDownTime - startPressTime) > 320 && (pressBDownTime - startPressTime) < 1300 && pressADownTime > 0) {
if (isShowToast) {
ToastUtils.showShort("方块 B 按AB组合 ");
}
sendAcc(true, -2);
isCombinationKey = true;
isCombinationKey = 3;
}
if (!isCombinationKey) {
if ((pressBDownTime - startPressTime) > 1700) {
ToastUtils.showShort("方块 长按B =1 ");
if (isCombinationKey != 3 && isCombinationKey != 1) {
if ((pressBDownTime - startPressTime) > 1320) {
if (isShowToast) {
ToastUtils.showShort("方块 长按B +1 ");
}
sendAcc(true, +1);
isCombinationKey = 2;
}
}
} else if (event.getAction() == KeyEvent.ACTION_UP) {
pressBUpTime = System.currentTimeMillis();
Log.e(TAG, "dispatchKeyEvent B up pressBUpTime = " + pressBUpTime + "--差-" + (pressBUpTime - startPressTime) + "--pressADownTime = " + pressADownTime);
if ((pressBUpTime - startPressTime) < 300 && !isCombinationKey) {
ToastUtils.showShort("方块 单击B 0 ");
if ((pressBUpTime - startPressTime) < 300 && isCombinationKey != 3) {
if (isShowToast) {
ToastUtils.showShort("方块 单击B 0 ");
}
sendAcc(false, 0.0);
isCombinationKey = 1;
}
pressBDownTime = 0;
isPressEnd = false;
isCombinationKey = false;
UiThreadHandler.postDelayed(new Runnable() {
@Override
public void run() {
isCombinationKey = 0;
}
}, 300);
}
return true;
} else if (event.getKeyCode() == KeyEvent.KEYCODE_C) { //单击左变道,长按无操作
if (event.getAction() == KeyEvent.ACTION_DOWN) {
pressCDownTime = System.currentTimeMillis();
if (!isCombinationKey) {
if ((pressCDownTime - startPressTime) > 1700) {
if ((pressCDownTime - startPressTime) > 1320) {
if (isShowToast) {
ToastUtils.showShort("方块 长按C 无操作 ");
}
}
} else if (event.getAction() == KeyEvent.ACTION_UP) {
pressCUpTime = System.currentTimeMillis();
isPressEnd = false;
isCombinationKey = false;
if ((pressCUpTime - startPressTime) < 300) {
ToastUtils.showShort("方块 单击C ← 向左变道 ");
if (isShowToast) {
ToastUtils.showShort("方块 单击C ← 向左变道 ");
}
CallerAutoPilotManager.INSTANCE.sendOperatorChangeLaneLeft();
}
}
@@ -336,17 +364,18 @@ public class MainLauncherActivity extends MainActivity implements IMogoIntentLis
} else if (event.getKeyCode() == KeyEvent.KEYCODE_D) { //单击向右变道,双击无操作
if (event.getAction() == KeyEvent.ACTION_DOWN) {
pressDDownTime = System.currentTimeMillis();
if (!isCombinationKey) {
if ((pressDDownTime - startPressTime) > 1700) {
if ((pressDDownTime - startPressTime) > 1320) {
if (isShowToast) {
ToastUtils.showShort("方块 长按D 无操作 ");
}
}
} else if (event.getAction() == KeyEvent.ACTION_UP) {
pressDUpTime = System.currentTimeMillis();
isPressEnd = false;
isCombinationKey = false;
if ((pressDUpTime - startPressTime) < 300) {
ToastUtils.showShort("方块 单击D → 向右变道 ");
if (isShowToast) {
ToastUtils.showShort("方块 单击D → 向右变道 ");
}
CallerAutoPilotManager.INSTANCE.sendOperatorChangeLaneRight();
}
}
@@ -355,28 +384,29 @@ public class MainLauncherActivity extends MainActivity implements IMogoIntentLis
} else if (event.getKeyCode() == KeyEvent.KEYCODE_E) { //单击启动自驾,长按鸣笛
if (event.getAction() == KeyEvent.ACTION_DOWN) {
pressEDownTime = System.currentTimeMillis();
if (!isCombinationKey) {
if ((pressEDownTime - startPressTime) > 1700) {
if ((pressEDownTime - startPressTime) > 1320) {
if (isShowToast) {
ToastUtils.showShort("方块 长按E 鸣笛 ");
CallerAutoPilotManager.INSTANCE.sendOperatorSetHorn(1);
if (timerHorn == null) {
timerHorn = new Timer();
}
timerHorn.schedule(new TimerTask() {
@Override
public void run() {
CallerAutoPilotManager.INSTANCE.sendOperatorSetHorn(2);
timerHorn = null;
}
}, 500);
}
CallerAutoPilotManager.INSTANCE.sendOperatorSetHorn(1);
if (timerHorn == null) {
timerHorn = new Timer();
}
timerHorn.schedule(new TimerTask() {
@Override
public void run() {
CallerAutoPilotManager.INSTANCE.sendOperatorSetHorn(2);
timerHorn = null;
}
}, 500);
}
} else if (event.getAction() == KeyEvent.ACTION_UP) {
pressEUpTime = System.currentTimeMillis();
isPressEnd = false;
isCombinationKey = false;
if ((pressEUpTime - startPressTime) < 300) {
ToastUtils.showShort("方块 单击E 开启自动驾驶 ");
if (isShowToast) {
ToastUtils.showShort("方块 单击E 开启自动驾驶 ");
}
CallerAutoPilotManager.INSTANCE.startAutoPilot(CallerAutoPilotStatusListenerManager.INSTANCE.getAutoPilotStatusInfo().getAutopilotControlParameters());
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 417 B

View File

@@ -1508,6 +1508,20 @@
app:layout_constraintRight_toLeftOf="@id/btnDrawTrolley"
app:layout_constraintTop_toBottomOf="@id/reset_changesight" />
<ToggleButton
android:id="@+id/btnDrawFusion"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_margin="2dp"
android:gravity="center"
android:padding="@dimen/dp_20"
android:textOff="打开fusion融合颜色替换"
android:textOn="关闭fusion融合颜色替换"
android:textSize="@dimen/dp_24"
app:layout_constraintLeft_toRightOf="@id/changesight_cross_btn"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@id/reset_changesight" />
<Button
android:id="@+id/btnDrawTrolley"
android:layout_width="0dp"
@@ -1862,7 +1876,7 @@
android:layout_height="wrap_content"
android:layout_weight="1"
android:padding="@dimen/dp_10"
android:text="融合感知数据"
android:text="车端感知数据"
android:textColor="#000"
android:textSize="@dimen/dp_24" />
@@ -1882,7 +1896,7 @@
android:layout_height="wrap_content"
android:layout_weight="1"
android:padding="@dimen/dp_10"
android:text="融合V2I感知数据"
android:text="V2I感知数据"
android:textColor="#000"
android:textSize="@dimen/dp_24" />
@@ -1892,7 +1906,7 @@
android:layout_height="wrap_content"
android:layout_weight="1"
android:padding="@dimen/dp_10"
android:text="融合V2N-RSM感知数据"
android:text="V2N-RSM感知数据"
android:textColor="#000"
android:textSize="@dimen/dp_24" />

View File

@@ -63,9 +63,11 @@
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/ivGotoPersonalInfo"
android:layout_width="@dimen/dp_17"
android:layout_height="@dimen/dp_32"
android:src="@drawable/icon_right"
android:layout_width="@dimen/dp_64"
android:layout_height="@dimen/dp_64"
android:src="@drawable/och_arrow_right"
android:visibility="gone"
android:scaleType="center"
android:layout_marginRight="@dimen/dp_40"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="@+id/actvAccountPhone"

View File

@@ -9,9 +9,9 @@ object TrackerSourceColorHelper {
@SuppressLint("NewApi")
fun filterData(data: TrackedObject): Boolean {
if (!FunctionBuildConfig.isDrawUnknownIdentifyData
&& data.type == TrafficTypeEnum.TYPE_TRAFFIC_ID_WEI_ZHI.type
) {
if (!FunctionBuildConfig.isDrawUnknownIdentifyData && data.type == TrafficTypeEnum.TYPE_TRAFFIC_ID_WEI_ZHI.type
|| data.type == TrafficTypeEnum.TYPE_TRAFFIC_ID_501.type || data.type == TrafficTypeEnum.TYPE_TRAFFIC_ID_502.type
) {
return true
}
var trackIPCFilter = true
@@ -96,7 +96,7 @@ object TrackerSourceColorHelper {
* 是否为融合数据,融合数据来源size >=2
*/
fun isFusion(data: TrackedObject): Boolean {
return data.trackedSourceList.size > 1
return FunctionBuildConfig.isFusionColor && data.trackedSourceList.size > 1
}
/**

View File

@@ -0,0 +1,7 @@
package com.mogo.eagle.core.function.overview
class OverViewConst {
companion object {
const val CLOUD_HOST = "https://eagle-qa.zhidaozhixing.com"
}
}

View File

@@ -0,0 +1,11 @@
package com.mogo.eagle.core.function.overview.remote
import io.reactivex.Observable
import retrofit2.http.GET
import retrofit2.http.Query
interface OverViewServiceApi {
@GET("/eagleEye-mis/config/queryV2NInformation")
fun queryAllV2XEventsByLineId(@Query("lineId") lineId: String, @Query("sn") sn: String): Observable<V2XEventResult>
}

View File

@@ -0,0 +1,70 @@
package com.mogo.eagle.core.function.overview.remote
import androidx.annotation.Keep
import com.google.gson.annotations.SerializedName
import com.mogo.eagle.core.data.BaseData
@Keep
data class V2XEventResult (
@SerializedName("result")
var result: Result?
): BaseData()
@Keep
data class Result(
@SerializedName("eventList")
var v2XEventList: List<V2XEvent>?
)
@Keep
data class V2XEvent(
@SerializedName("receiveTime")
var receiveTime: Long,
@SerializedName("detectTime")
var detectTime: Long,
@SerializedName("id")
var id: String?,
@SerializedName("center")
var center: Center?,
@SerializedName("centerRoad")
var centerRoad: CenterRoad?,
@SerializedName("radius")
var radius: Double,
@SerializedName("type")
var type: Int
)
@Keep
data class Center(
@SerializedName("lat")
var lat: Double,
@SerializedName("lon")
var lon: Double
)
@Keep
data class CenterRoad(
@SerializedName("bearing")
var bearing: Double,
@SerializedName("laneNo")
var laneNo: Long,
@SerializedName("roadId")
var roadId: String?,
@SerializedName("roadName")
var roadName: String?,
@SerializedName("tileId")
var tileId: Long
)

View File

@@ -1,16 +1,26 @@
package com.mogo.eagle.core.function.overview.vm
import androidx.lifecycle.*
import com.amap.api.maps.model.LatLng
import com.mogo.eagle.core.data.map.Infrastructure
import com.mogo.eagle.core.function.overview.OverViewConst
import com.mogo.eagle.core.function.overview.OverviewDao
import io.reactivex.disposables.CompositeDisposable
import com.mogo.eagle.core.function.overview.remote.OverViewServiceApi
import com.mogo.eagle.core.function.overview.remote.V2XEvent
import com.mogo.eagle.core.network.MoGoRetrofitFactory
import io.reactivex.Observable
import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.disposables.Disposable
import io.reactivex.functions.Consumer
import io.reactivex.schedulers.Schedulers
import kotlinx.coroutines.launch
import java.util.concurrent.TimeUnit
class OverViewModel(
private val overviewDao: OverviewDao
) : ViewModel() {
private val _infStructures = MutableLiveData<List<Infrastructure>>()
private val _V2XEvents = MutableLiveData<List<V2XEvent>>()
private var disposable: Disposable? = null
val infStructures
get() = _infStructures
@@ -64,4 +74,34 @@ class OverViewModel(
}
}
}
fun getAllV2XEventsByLineId(lineId: String, sn: String) {
// 1分钟查询一次
disposable = Observable.interval(0, 60000, TimeUnit.SECONDS)
.flatMap {
MoGoRetrofitFactory.getInstance(OverViewConst.CLOUD_HOST)
.create(OverViewServiceApi::class.java)
.queryAllV2XEventsByLineId(lineId, sn)
.map {
if (it.code == 200 || it.code == 0) {
return@map it.result?.v2XEventList
} else {
return@map null
}
}
}
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe {
it?.apply {
_V2XEvents.value = this
}
}
}
fun getV2XEventLiveData() = _V2XEvents
fun stopQueryV2XEvents() {
disposable?.dispose()
}
}

View File

@@ -39,6 +39,8 @@ import com.mogo.eagle.core.function.call.hmi.CallerHmiManager;
import com.mogo.eagle.core.function.call.map.CallerMapLocationListenerManager;
import com.mogo.eagle.core.function.map.R;
import com.mogo.eagle.core.function.overview.InfStructureManager;
import com.mogo.eagle.core.function.overview.remote.Center;
import com.mogo.eagle.core.function.overview.remote.V2XEvent;
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils;
import com.mogo.eagle.core.utilcode.mogo.MapAssetStyleUtils;
import com.mogo.eagle.core.utilcode.util.UiThreadHandler;
@@ -96,6 +98,8 @@ public class AMapCustomView
private boolean isFirstLocation = true;
CustomMapStyleOptions mCustomMapStyleOptions;
ArrayList<Marker> currMarkerList;
public AMapCustomView(Context context) {
this(context, null);
}
@@ -254,6 +258,51 @@ public class AMapCustomView
});
}
public void showV2XEventMarkers(List<V2XEvent> v2XEvents) {
if (v2XEvents == null || v2XEvents.size() <= 0) return;
ArrayList<MarkerOptions> markerOptionsList = new ArrayList<>();
for (V2XEvent event : v2XEvents) {
if (event.getType() != 10006) {
continue;
}
Center center = event.getCenter();
if (center != null) {
center.getLon();
MarkerOptions markerOption = new MarkerOptions();
LatLng latLng = new LatLng(center.getLat(),
center.getLon());
markerOption.position(latLng);
markerOption.icon(BitmapDescriptorFactory.fromResource(R.drawable.icon_warning_v2x_road_construction));
markerOptionsList.add(markerOption);
}
}
if (markerOptionsList.size() > 0) {
drawV2XMarkers(markerOptionsList);
}
}
public void drawV2XMarkers(ArrayList<MarkerOptions> markerOptionsList) {
currMarkerList = mAMap.addMarkers(markerOptionsList, false);
mAMap.setOnMarkerClickListener(marker -> {
List<Infrastructure> infList = posInfMap.get(marker.getPosition());
// 如果是摄像头
if (infList != null) {
CallerHmiManager.INSTANCE.showVideoDialog(infList);
return true;
}
return false;
});
}
public void clearV2XMarkers() {
if (currMarkerList != null) {
for (Marker marker : currMarkerList) {
marker.destroy();
}
currMarkerList = null;
}
}
@Override
protected void onDetachedFromWindow() {
super.onDetachedFromWindow();

View File

@@ -2,19 +2,26 @@ package com.mogo.eagle.core.function.smp;
import android.content.Context;
import android.os.Bundle;
import android.os.Looper;
import android.view.View;
import androidx.annotation.Nullable;
import com.alibaba.android.arouter.facade.annotation.Route;
import com.mogo.cloud.passport.MoGoAiCloudClientConfig;
import com.mogo.commons.mvp.BaseFragment;
import com.mogo.eagle.core.data.autopilot.AutopilotControlParameters;
import com.mogo.eagle.core.data.constants.MoGoFragmentPaths;
import com.mogo.eagle.core.data.map.MogoLatLng;
import com.mogo.eagle.core.function.api.map.smp.IMogoSmallMapProvider;
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager;
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager;
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotPlanningListenerManager;
import com.mogo.eagle.core.function.map.R;
import com.mogo.eagle.core.function.overview.InfStructureManager;
import com.mogo.eagle.core.function.overview.ViewModelExtKt;
import com.mogo.eagle.core.function.overview.vm.OverViewModel;
import com.mogo.eagle.core.utilcode.util.UiThreadHandler;
import java.util.List;
@@ -28,6 +35,7 @@ public class OverviewMapFragment extends BaseFragment
implements IMogoSmallMapProvider {
private final String TAG = "SmallMapFragment";
protected AMapCustomView mAMapCustomView;
private OverViewModel mViewModel;
@Override
public void onAttach(Context context) {
@@ -70,6 +78,18 @@ public class OverviewMapFragment extends BaseFragment
}
}
@Override
public void clearV2XMarkers() {
if (Thread.currentThread() != Looper.getMainLooper().getThread()) {
UiThreadHandler.post(() -> {
mAMapCustomView.clearV2XMarkers();
});
} else {
mAMapCustomView.clearV2XMarkers();
}
mViewModel.stopQueryV2XEvents();
}
@Override
public void drawablePolyline(List<MogoLatLng> coordinates) {
}
@@ -92,17 +112,36 @@ public class OverviewMapFragment extends BaseFragment
super.onActivityCreated(savedInstanceState);
// 主动查一次全局路径规划的数据
CallerAutoPilotManager.INSTANCE.getGlobalPath();
// queryInfStructure();
queryV2XEvents();
}
// private void queryInfStructure() {
// mViewModel = ViewModelExtKt.obtainViewModel(this, OverViewModel.class);
// mViewModel.getInfStructuresMap().observe(this.getViewLifecycleOwner(), map -> {
// mAMapCustomView.updateInfStructures(map);
// });
// // 本地数据库查询
// mViewModel.fetchInfStructures();
// }
private void queryV2XEvents() {
mViewModel = ViewModelExtKt.obtainViewModel(this, OverViewModel.class);
mViewModel.getV2XEventLiveData().observe(this.getViewLifecycleOwner(), v2XEvents -> {
mAMapCustomView.showV2XEventMarkers(v2XEvents);
});
long lineId = getLineId();
if (lineId > 0) {
mViewModel.getAllV2XEventsByLineId("" + lineId, MoGoAiCloudClientConfig.getInstance().getSn());
}
}
/**
*
* @return Taxi的下发的轨迹id
*/
private long getLineId() {
long lineId = -1;
AutopilotControlParameters parameter = CallerAutoPilotStatusListenerManager.INSTANCE.getAutoPilotStatusInfo()
.getAutopilotControlParameters();
if (parameter != null) {
if (parameter.autoPilotLine != null) {
lineId = parameter.autoPilotLine.getLineId();
}
}
return lineId;
}
@Override
public void onPause() {

View File

@@ -130,15 +130,7 @@ object DataManager {
}
fun removeRecordInfo(key: String, value: Any) {
if (Thread.currentThread() == Looper.getMainLooper().thread) {
scope.launch {
withContext(Dispatchers.Default) {
removedRecordMap[key] = value
}
}
} else {
removedRecordMap[key] = value
}
removedRecordMap[key] = value
}
/**

View File

@@ -42,11 +42,8 @@ class MsgBoxProvider : IMsgBoxProvider {
return DataManager.getRecordBagData()
}
override fun removeRecordInfo(key: String, value: Any) {
return DataManager.removeRecordInfo(key, value)
}
override fun deleteBoxBean(context: Context, msgBoxBean: MsgBoxBean) {
override fun removeRecordInfo(context: Context, msgBoxBean: MsgBoxBean, key: String) {
DataManager.removeRecordInfo(key, key)
DataManager.delMsgBoxBean(context, msgBoxBean)
}

View File

@@ -21,12 +21,9 @@ class MoGoObuProvider : IMoGoObuProvider {
private val TAG = "MoGoObuProvider"
private var mContext: Context? = null
private val busObuIp = "192.168.8.199"
private val taxiObuIp = "192.168.1.199"
// private val taxiObuIp = "192.168.1.186"
override val functionName: String
get() = TAG
@@ -35,7 +32,7 @@ class MoGoObuProvider : IMoGoObuProvider {
}
override fun init(context: Context) {
CallerLogger.d("$M_OBU$TAG", "初始化蘑菇自研OBU…… localIp = " + CommonUtils.getLocalIPAddress())
CallerLogger.d("$M_OBU$TAG", "初始化蘑菇自研OBU…… localIp = " + CommonUtils.getLocalIPAddress() + "--")
//bus乘客版本obu功能去掉
if (AppIdentityModeUtils.isBus(FunctionBuildConfig.appIdentityMode) && AppIdentityModeUtils.isPassenger(
FunctionBuildConfig.appIdentityMode
@@ -46,30 +43,33 @@ class MoGoObuProvider : IMoGoObuProvider {
mContext = context
mContext?.let {
if (AppIdentityModeUtils.isBus(FunctionBuildConfig.appIdentityMode)) { //bus 司机端
//mogo obu
MogoPrivateObuNewManager.INSTANCE.connectObu(
it,
busObuIp,
CommonUtils.getIpAddressString()
)
//old obu
val ipAddress =
SharedPrefsMgr.getInstance(context).getString(MoGoConfig.OBU_IP, busObuIp)
MogoPrivateObuManager.INSTANCE.init(context, ipAddress)
} else if (AppIdentityModeUtils.isTaxi(FunctionBuildConfig.appIdentityMode)) { //taxi 司机端和乘客端
//mogo obu
MogoPrivateObuNewManager.INSTANCE.connectObu(
it,
taxiObuIp,
ipAddress,
CommonUtils.getIpAddressString()
)
//old obu
MogoPrivateObuManager.INSTANCE.init(context, ipAddress)
CallerLogger.d("$M_OBU$TAG", "bus 司机 ipAddress = $ipAddress ---localIp = ${CommonUtils.getIpAddressString()}")
} else if (AppIdentityModeUtils.isTaxi(FunctionBuildConfig.appIdentityMode)) { //taxi 司机端和乘客端
val ipAddress =
SharedPrefsMgr.getInstance(context).getString(MoGoConfig.OBU_IP, taxiObuIp)
//mogo obu
MogoPrivateObuNewManager.INSTANCE.connectObu(
it,
ipAddress,
CommonUtils.getIpAddressString()
)
//old obu
MogoPrivateObuManager.INSTANCE.init(context, ipAddress)
CallerLogger.d("$M_OBU$TAG", "taxi 司机端和乘客端 ipAddress = $ipAddress ---localIp = ${CommonUtils.getIpAddressString()}")
}
}
}

View File

@@ -94,14 +94,22 @@ object TrafficDataConvertUtilsNew {
trafficData.heading = info.participant.heading
trafficData.speed = info.participant.speed
/**
* 交通参与者类型
* 0未知
* 1机动车
* 2非机动车
* 3行人
* 4OBU自身
*/
when (info.participant.ptcType) {
// 未知
0 -> {
trafficData.type = TrafficTypeEnum.TYPE_TRAFFIC_ID_WEI_ZHI
}
//机动车 //TODO
//机动车
1 -> {
trafficData.type = TrafficTypeEnum.TYPE_TRAFFIC_ID_TA_CHE
trafficData.type = TrafficTypeEnum.TYPE_TRAFFIC_ID_MOTO
}
// 非机动车
2 -> {
@@ -113,16 +121,6 @@ object TrafficDataConvertUtilsNew {
}
}
/**
* 交通参与者类型
* 0未知
* 1机动车
* 2非机动车
* 3行人
* 4OBU自身
*/
val ptcType = 0
// 判断车辆V2X预警级别调整车辆颜色
if (info.warningMsg != null && info.warningMsg.warningData != null) {
trafficData.threatLevel = info.warningMsg.warningData[0].warningLevel

View File

@@ -56,6 +56,14 @@ object FunctionBuildConfig {
@JvmField
var isBeautyMode = true
/**
* 是否开启感知物替换颜色功能
* 默认关闭
*/
@Volatile
@JvmField
var isFusionColor = false
/**
* 当前APP的身份模式
*

View File

@@ -146,13 +146,13 @@ enum class EventTypeEnumNew(
content = "前车碰撞预警",
tts = "小心前车"
),
TYPE_USECASE_ID_ICW(
1.toString(),
"交叉路口碰撞预警",
poiTypeSrcVr = R.drawable.icon_warning_v2x_collision_warning,
content = "交叉路口碰撞预警",
tts = "注意交叉路口车辆"
),
// TYPE_USECASE_ID_ICW(
// 1.toString(),
// "交叉路口碰撞预警",
// poiTypeSrcVr = R.drawable.icon_warning_v2x_collision_warning,
// content = "交叉路口碰撞预警",
// tts = "注意交叉路口车辆"
// ),
TYPE_USECASE_ID_AVW(
7.toString(),
"异常车辆提醒",
@@ -218,21 +218,6 @@ enum class EventTypeEnumNew(
tts = "前方路口左转急弯,减速慢行",
),
//TODO
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_LTA(
2.toString(),
"左转辅助",
@@ -241,13 +226,6 @@ enum class EventTypeEnumNew(
tts = "注意路口对向来车"
),
TYPE_USECASE_ID_IVS(
3.toString(),
"车内标牌",
poiTypeSrcVr = R.drawable.icon_warning_v2x_road_construction,
content = "车内标牌",
tts = ""
),
TYPE_USECASE_ID_TJW( //TODO
4.toString(),
"前方拥堵提醒",
@@ -256,32 +234,16 @@ enum class EventTypeEnumNew(
tts = "前方拥堵,减速慢行"
),
//TODO 不能使用之前obu的定义 ObuConstants.USE_CASE_ID.HLW.toString(),
TYPE_USECASE_OPTIMAL_LANE(
"111",
"最优车道",
poiTypeSrcVr = R.drawable.v2x_icon_live_logo,
content = "最优车道",
tts = "最优车道"
),
TYPE_USECASE_ID_HLW(
1.toString(),
"道路危险情况预警",
poiTypeSrcVr = R.drawable.icon_warning_v2x_road_dangerous,
content = "道路危险情况预警",
tts = "前方路况危险,小心行驶"
),//(如果能给出具体的类别,则播报具体危险类别)
TYPE_USECASE_ID_IVP(
0x2.toString(),
0x1.toString(),
"闯红灯预警",
poiTypeSrcVr = R.drawable.icon_warning_v2x_traffic_lights_red,
content = "路口红灯,禁止通行",
tts = "路口红灯,禁止通行"
),
TYPE_USECASE_ID_IVP_GREEN(
0x2B091.toString(),
0x2.toString(),
"绿波通行",
poiTypeSrcVr = R.drawable.icon_warning_v2x_traffic_lights_green,
content = "建议车速 %s KM/H",
@@ -305,22 +267,6 @@ enum class EventTypeEnumNew(
tts = "注意超速车辆"
),
TYPE_USECASE_ID_BREAKDOWN_WARNING(
101.toString(),
"注意故障车辆",
poiTypeSrcVr = R.drawable.icon_warning_v2x_collision_warning,
content = "注意故障车辆",
tts = "注意故障车辆"
),
TYPE_USECASE_ID_ROAD_PARKING(
412.toString(),
"注意异常停车",
poiTypeSrcVr = R.drawable.icon_warning_v2x_no_parking,
content = "注意异常停车",
tts = "注意异常停车"
),
TYPE_USECASE_ID_ROAD_TRAMCAR(
0x2C01.toString(),
"前方有轨电车提醒",
@@ -336,41 +282,6 @@ enum class EventTypeEnumNew(
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(),
"禁止停车",
@@ -740,32 +651,22 @@ enum class EventTypeEnumNew(
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_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_VIP_IDENTIFICATION.poiType -> TYPE_VIP_IDENTIFICATION.poiTypeSrcVr
@@ -782,32 +683,22 @@ enum class EventTypeEnumNew(
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_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_VIP_IDENTIFICATION.poiType -> TYPE_VIP_IDENTIFICATION.content
@@ -825,32 +716,22 @@ enum class EventTypeEnumNew(
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_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 //TODO
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_VIP_IDENTIFICATION.poiType -> TYPE_VIP_IDENTIFICATION.tts

View File

@@ -0,0 +1,80 @@
package com.mogo.eagle.core.data.enums
import com.mogo.eagle.core.data.R
/**
* 弱势交通分类
*/
enum class EventTypeEnumWeaknessTraffic(
val poiType: String, val poiTypeStr: String = "",
val poiTypeStrVr: String = "",
val poiTypeSrcVr: Int = R.drawable.v2x_icon_live_logo,
val content: String = "", val tts: String = ""
) {
TYPE_USECASE_ID_VRUCW_MOTOR_VEHICLES(
1.toString(),
"弱势交通参与者碰撞预警",
poiTypeSrcVr = R.drawable.icon_warning_v2x_motorcycle_collision,
content = "注意机动车",
tts = "注意机动车"
),
TYPE_USECASE_ID_VRUCW_NOT_MOTOR_VEHICLES( //TODO 图标需要换
2.toString(),
"弱势交通参与者碰撞预警",
poiTypeSrcVr = R.drawable.icon_warning_v2x_motorcycle_collision,
content = "注意非机动车",
tts = "注意非机动车"
),
TYPE_USECASE_ID_VRUCW_PERSON(
3.toString(),
"弱势交通参与者碰撞预警",
poiTypeSrcVr = R.drawable.icon_warning_v2x_pedestrian_crossing,
content = "注意行人",
tts = "注意行人"
),
TYPE_ERROR(
0.toString(),
"未知/错误/异常",
poiTypeSrcVr = R.drawable.icon_warning_v2x_abnormal_vehicle,
content = "",
tts = ""
);
companion object {
@JvmStatic
fun getWarningIcon(poiType: String?): Int {
return when (poiType) {
TYPE_USECASE_ID_VRUCW_PERSON.poiType -> TYPE_USECASE_ID_VRUCW_PERSON.poiTypeSrcVr
TYPE_USECASE_ID_VRUCW_NOT_MOTOR_VEHICLES.poiType -> TYPE_USECASE_ID_VRUCW_NOT_MOTOR_VEHICLES.poiTypeSrcVr
TYPE_USECASE_ID_VRUCW_NOT_MOTOR_VEHICLES.poiType -> TYPE_USECASE_ID_VRUCW_NOT_MOTOR_VEHICLES.poiTypeSrcVr
else -> TYPE_ERROR.poiTypeSrcVr
}
}
@JvmStatic
fun getWarningContent(poiType: String?): String {
return when (poiType) {
TYPE_USECASE_ID_VRUCW_PERSON.poiType -> TYPE_USECASE_ID_VRUCW_PERSON.content
TYPE_USECASE_ID_VRUCW_MOTOR_VEHICLES.poiType -> TYPE_USECASE_ID_VRUCW_MOTOR_VEHICLES.content
TYPE_USECASE_ID_VRUCW_NOT_MOTOR_VEHICLES.poiType -> TYPE_USECASE_ID_VRUCW_NOT_MOTOR_VEHICLES.content
else -> TYPE_ERROR.content
}
}
@JvmStatic
fun getWarningTts(poiType: String?): String {
return when (poiType) {
TYPE_USECASE_ID_VRUCW_PERSON.poiType -> TYPE_USECASE_ID_VRUCW_PERSON.tts
TYPE_USECASE_ID_VRUCW_MOTOR_VEHICLES.poiType -> TYPE_USECASE_ID_VRUCW_MOTOR_VEHICLES.tts
TYPE_USECASE_ID_VRUCW_NOT_MOTOR_VEHICLES.poiType -> TYPE_USECASE_ID_VRUCW_NOT_MOTOR_VEHICLES.tts
else -> TYPE_ERROR.tts
}
}
}
}

View File

@@ -16,6 +16,20 @@ enum class TrafficTypeEnum(
var traffic3DNightIconId: Int
) {
TYPE_TRAFFIC_ID_501(
501,
"未知数据",
R.raw.traffic_xiankuang,
R.raw.traffic_xiankuang,
R.raw.traffic_xiankuang
),
TYPE_TRAFFIC_ID_502(
502,
"未知数据",
R.raw.traffic_xiankuang,
R.raw.traffic_xiankuang,
R.raw.traffic_xiankuang
),
TYPE_TRAFFIC_ID_WEI_ZHI(
100,
"未知数据",

View File

@@ -231,14 +231,6 @@ enum class V2iEventTypeEnum(
tts = ""
),
TYPE_USECASE_ID_HLW(
0x2B04.toString(),
"道路危险情况预警",
poiTypeSrcVr = R.drawable.icon_warning_v2x_road_dangerous,
content = "道路危险情况预警",
tts = "前方路况危险,小心行驶"
),//(如果能给出具体的类别,则播报具体危险类别)
TYPE_USECASE_ID_IVP(
0x2.toString(),
"闯红灯预警",

View File

@@ -29,4 +29,6 @@ public interface IMogoSmallMapProvider {
* 清除路径线
*/
void clearPolyline();
default void clearV2XMarkers() {}
}

View File

@@ -21,9 +21,7 @@ interface IMsgBoxProvider: IMoGoFunctionServerProvider {
*/
fun getCachedRecordBagData(): List<MsgBoxBean>
fun removeRecordInfo(key: String, value: Any)
fun deleteBoxBean(context: Context, msgBoxBean: MsgBoxBean)
fun removeRecordInfo(context: Context, msgBoxBean: MsgBoxBean, key: String)
fun getDismissTime(): Long
}

View File

@@ -47,4 +47,9 @@ object CallerSmpManager : CallerBase() {
fun hidePanel() {
mogoSmallMapProvider.hidePanel()
}
@JvmStatic
fun clearV2XMarkers() {
mogoSmallMapProvider.clearV2XMarkers()
}
}

View File

@@ -10,11 +10,8 @@ import androidx.lifecycle.LifecycleEventObserver
import androidx.lifecycle.LifecycleOwner
import com.mogo.eagle.core.data.config.FunctionBuildConfig
import com.mogo.eagle.core.data.map.MapRoadInfo.StopLine
import com.mogo.eagle.core.data.map.MogoLatLng
import com.mogo.eagle.core.function.call.map.CallerMapRoadListenerManager.OnRoadListener
import com.mogo.eagle.core.function.call.map.CallerVisualAngleManager.Scene.CrossRoad
import com.mogo.eagle.core.function.call.map.CallerVisualAngleManager.Scene.Default
import com.mogo.eagle.core.function.call.map.CallerVisualAngleManager.Scene.LowSpeed
import com.mogo.eagle.core.function.call.map.CallerVisualAngleManager.Scene.*
import com.mogo.eagle.core.utilcode.kotlin.lifeCycleOwner
import com.mogo.eagle.core.utilcode.kotlin.safeCancel
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
@@ -35,8 +32,6 @@ object CallerVisualAngleManager {
private const val TAG = "VisualAngle"
private const val MaxDisplayThreshold = 30_000 //最大展示阈值
@Volatile
private var hasCrossRoad = false
@@ -61,6 +56,7 @@ object CallerVisualAngleManager {
private interface IAttach {
val angle: VisualAngleMode
val priority: Int
val displayThreshold: Long //最大展示时长 > 0; 表示最长展示多长时间, -1 表示,一直展示,直到触发默认视角, 0: 默认视角专用值,
}
private val listener = object : OnRoadListener {
@@ -70,7 +66,7 @@ object CallerVisualAngleManager {
if (oldRoadId != roadId) {
if (hasCrossRoad) {
hasCrossRoad = false
changeVisualAngle(Default())
changeVisualAngle(CrossRoad(false))
}
}
this.roadId = roadId
@@ -79,7 +75,7 @@ object CallerVisualAngleManager {
override fun onStopLineInfo(info: StopLine) {
if (!hasCrossRoad && info.distanceOfCarToStopLine <= 30.0) {
hasCrossRoad = true
changeVisualAngle(CrossRoad)
changeVisualAngle(CrossRoad(true))
}
}
}
@@ -116,7 +112,10 @@ object CallerVisualAngleManager {
override val angle: VisualAngleMode = VisualAngleMode.MODE_MEDIUM_SIGHT
override val priority: Int = 0
override val priority: Int = 1
override val displayThreshold: Long
get() = 0
override fun toString(): String {
return "Default(delay=$delay, unit=$unit, angle=$angle, priority=$priority)"
@@ -126,11 +125,14 @@ object CallerVisualAngleManager {
/**
* 变道-接收到转向灯信息号
*/
object Turning: Scene() {
class Turning(var open: Boolean = false): Scene() {
override val angle: VisualAngleMode = VisualAngleMode.MAP_STYLE_VR_ANGLE_TOP
override val priority: Int = 0
override val priority: Int = 3
override val displayThreshold: Long
get() = -1
}
/**
@@ -140,7 +142,10 @@ object CallerVisualAngleManager {
override val angle: VisualAngleMode = VisualAngleMode.MAP_STYLE_VR_ANGLE_300
override val priority: Int = 0
override val priority: Int = 2
override val displayThreshold: Long
get() = SECONDS.toMillis(8)
}
/**
@@ -150,29 +155,21 @@ object CallerVisualAngleManager {
override val angle: VisualAngleMode = VisualAngleMode.MODE_LONG_SIGHT
override val priority: Int = 0
override val priority: Int = 5
override val displayThreshold: Long
get() = SECONDS.toMillis(8)
}
/**
* 车量低速行驶
*/
class LowSpeed(val lat: Double, val lon: Double): Scene() {
override val angle: VisualAngleMode = VisualAngleMode.MODE_CLOSE_SIGHT
override val priority: Int = 0
override fun toString(): String {
return "LowSpeed(lat=$lat, lon=$lon, angle=$angle, priority=$priority)"
}
}
/**
* 十字路口
*/
object CrossRoad: Scene() {
class CrossRoad(var open: Boolean = false): Scene() {
override val angle: VisualAngleMode = VisualAngleMode.MAP_STYLE_VR_ANGLE_CROSS
override val priority: Int = 0
override val priority: Int = 4
override val displayThreshold: Long
get() = -1
}
}
@@ -183,13 +180,8 @@ object CallerVisualAngleManager {
* @param isDisplay: 是否正在展示
* @param triggerTime: 触发时间
*/
private data class Record(val target: Scene, var isDisplay: Boolean = false, val triggerTime: Long): Comparable<Record> {
private data class Record(val target: Scene, var isDisplay: Boolean = false, var triggerTime: Long): Comparable<Record> {
override fun compareTo(other: Record): Int {
//大根堆
if (triggerTime != other.triggerTime) {
//时间越晚,越靠近堆顶
return if (triggerTime > other.triggerTime) -1 else 1
}
//如果时间一样,优先级越高,越靠近堆顶
return other.target.priority - target.priority
}
@@ -212,21 +204,50 @@ object CallerVisualAngleManager {
if (displayed == null) {
CallerLogger.d("${M_DEVA}${TAG}", "触发场景:${scene} --- 2 ---")
val top = getTop() //堆顶
if (top != null && top.target.priority > scene.priority) {
CallerLogger.d("${M_DEVA}${TAG}", "触发场景:${scene} --- 3 ---")
doChangeAngle(top)
heap += Record(scene, triggerTime = triggerTime)
if (top != null) {
if (top.target.priority >= scene.priority) {
CallerLogger.d("${M_DEVA}${TAG}", "触发场景:${scene} --- 3 ---")
top.triggerTime = triggerTime
doChangeAngle(top)
synchronized(heap){
heap += Record(scene, triggerTime = -1)
}
} else {
CallerLogger.d("${M_DEVA}${TAG}", "触发场景:${scene} --- 4 ---")
doChangeAngle(Record(scene, triggerTime = triggerTime))
}
} else {
CallerLogger.d("${M_DEVA}${TAG}", "触发场景:${scene} --- 4 ---")
doChangeAngle(Record(scene, triggerTime = triggerTime))
}
} else {
if (scene.javaClass == displayed.target.javaClass) {
CallerLogger.d("${M_DEVA}${TAG}", "触发场景:${scene} --- 5 ---")
defaultDelayJob?.safeCancel()
return@launch
}
val prev = displayed.target
val prevTriggerTime = displayed.triggerTime
if (scene is Turning) {
val isOpen = scene.open
if (!isOpen) {
changeVisualAngle(Default())
return@launch
}
}
if (scene is CrossRoad) {
val isOpen = scene.open
if (!isOpen) {
changeVisualAngle(Default())
return@launch
}
}
if (prev.priority >= scene.priority && (prev is RoadEvent || prev is TooClose)) {
val displayDuration = triggerTime - prevTriggerTime
if (displayDuration < prev.displayThreshold) {
return@launch
}
}
if (scene is Default) {
CallerLogger.d("${M_DEVA}${TAG}", "触发场景:${scene} --- 6 ---")
defaultDelayJob?.safeCancel()
@@ -248,12 +269,8 @@ object CallerVisualAngleManager {
} else {
CallerLogger.d("${M_DEVA}${TAG}", "触发场景:${scene} --- 10 ---")
defaultDelayJob?.safeCancel()
val delta = triggerTime - displayed.triggerTime
if (delta >= MaxDisplayThreshold) {
CallerLogger.d("${M_DEVA}${TAG}", "触发场景:${scene} --- 11 ---")
if (displayed.target.priority < scene.priority) {
doChangeAngle(Record(scene, triggerTime = triggerTime))
} else {
CallerLogger.d("${M_DEVA}${TAG}", "触发场景:${scene} --- 12 ---")
}
}
}
@@ -262,6 +279,7 @@ object CallerVisualAngleManager {
@OptIn(InternalCoroutinesApi::class)
private fun doChangeAngle(record: Record) {
val angle = record.target.angle
CallerMapUIServiceManager.getMapUIController()?.also {
CallerLogger.d("${M_DEVA}${TAG}", "触发场景:${record.target} --- 13 ---")
if (record.target !is Default) {
@@ -270,14 +288,8 @@ object CallerVisualAngleManager {
heap += record
}
}
val target = record.target
if (target is LowSpeed) {
CallerLogger.d("${M_DEVA}${TAG}", "触发场景:${record.target} --- 14 ---")
it.changeMapVisualAngle(record.target.angle, MogoLatLng(target.lat, target.lon))
} else {
CallerLogger.d("${M_DEVA}${TAG}", "触发场景:${record.target} --- 15 ---")
it.changeMapVisualAngle(record.target.angle, null)
}
CallerLogger.d("${M_DEVA}${TAG}", "触发场景:${record.target} --- 15 ---> angle: $angle")
it.changeMapVisualAngle(angle, null)
}
}

View File

@@ -45,18 +45,11 @@ object CallerMsgBoxManager {
}
/**
* 用户已处理的Bag包需要删除
* key: Bag包的唯一标识keyvalue:任意非空的值
* 用户已处理的Bag包需要删除(上传或取消都包含)
* key: Bag包的唯一标识key, msgBoxBean: UI展示的那个对象而不是重新new的
*/
fun removeRecordInfo(key: String, value: Any) {
providerApi?.removeRecordInfo(key, value)
}
/**
* 删除消息盒子中存入数据库的数据比如已经处理的录制bag信息
*/
fun deleteBoxBean(context: Context, msgBoxBean: MsgBoxBean) {
providerApi?.deleteBoxBean(context, msgBoxBean)
fun removeRecordInfo(context: Context, msgBoxBean: MsgBoxBean, key: String) {
providerApi?.removeRecordInfo(context, msgBoxBean, key)
}
fun getDismissTime(): Long {

View File

@@ -8,6 +8,9 @@ class SceneConstant {
const val M_NETWORK = "M_NETWORK-"
const val M_UTIL = "M_UTIL-"
//Main
const val M_MAIN = "M_MAIN-"
//core业务module
const val M_ADAS_IMPL = "M_ADAS_IMPL-"
const val M_BINDING = "M_BINDING-"

View File

@@ -63,7 +63,7 @@ BIZCONFIG_VERSION=1.3.2
SERVICE_BIZ_VERSION=1.2.4
################ 外部依赖引用 ################
# loglib
LOGLIB_VERSION=1.4.5
LOGLIB_VERSION=1.5.7
######## MogoAiCloudSDK Version ########
# 网络请求LOGLIB_VERSION
MOGO_NETWORK_VERSION=1.4.3.26

View File

@@ -130,6 +130,7 @@ public class ObjectUtils {
markerOptions.setRotateAngle((float) trafficData.getHeading());
markerOptions.setLat(trafficData.getLatitude());
markerOptions.setLon(trafficData.getLongitude());
markerOptions.setTime(Double.valueOf(trafficData.getSatelliteTime() * 1000).longValue());
if(trafficData.getColor()!=null && !trafficData.getColor().isEmpty()){
markerOptions.setColor(trafficData.getColor());
}else{

View File

@@ -29,7 +29,6 @@ import com.mogo.eagle.core.utilcode.util.ThreadUtils;
import com.mogo.eagle.core.utilcode.util.ToastUtils;
import com.mogo.tts.base.IMogoTTS;
import com.mogo.tts.base.IMogoTTSCallback;
import com.mogo.tts.base.MogoTTSConstants;
import com.mogo.tts.base.PreemptType;
import com.zhidao.auto.platform.voice.VoiceClient;
import com.zhidao.voicesdk.MogoVoiceManager;
@@ -118,6 +117,7 @@ public class PadTTS implements IMogoTTS, VoiceClient.VoiceCmdCallBack, OnTtsList
private String[] mBackResBinArray = new String[]{TTS_BACK_RES_ZHILING, TTS_BACK_RES_GUODGM};
// 单独的语音播放
private boolean mHasAuth;
private int retryCount;
private void initFlushStatus() {
if (!mHasFlush) {
@@ -145,44 +145,51 @@ public class PadTTS implements IMogoTTS, VoiceClient.VoiceCmdCallBack, OnTtsList
// DUILiteSDK.openLog();//开启日志需要在sdk init 之前调用
// }
DUILiteSDK.init(mContext, new DUILiteConfig.Builder()
.setApiKey("113cc31f6385113cc31f6385618c86f5")
.setProductId("278586132")
.setProductKey("1fe5930844b488a8d32d9ef7717be7dc")
.setProductSecret("f601ecc407986b548ac8ab2a9144162e")
.setAuthConfig(onlineBuilder.create())//授权配置
// .setRecorderConfig(recorderConfig)//设置录音配置
// .setUploadConfig(uploadConfig)//设置日志上传配置
// .setTtsCacheDir("/sdcard/speech/cache") //设置tts cache文件存放目录
.setEchoConfig(echoConfig)
.create(), new DUILiteSDK.InitListener() {
@Override
public void success() {
CallerLogger.INSTANCE.d(TAG, "授权成功");
ThreadUtils.runOnUiThread(() -> {
mHasAuth = true;
initTtsEngine();
});
}
@Override
public void error(String errorCode, final String errorInfo) {
CallerLogger.INSTANCE.e(TAG, "error code : " + errorCode + " , error info :" + errorInfo);
// throw new IllegalStateException("授权失败,请检查授权配置");
}
});
boolean isAuthorized = DUILiteSDK.isAuthorized(mContext);//查询授权状态DUILiteSDK.init之后随时可以调
CallerLogger.INSTANCE.d(TAG, "DUILite SDK is isAuthorized " + isAuthorized);
String core_version = DUILiteSDK.getCoreVersion();//获取内核版本号
CallerLogger.INSTANCE.d(TAG, "core version is: " + core_version);
initDUILiteSDK(onlineBuilder, echoConfig);
} catch (Exception e) {
e.printStackTrace();
ToastUtils.showShort("PadTTS 模块初始化异常");
}
}
private void initDUILiteSDK(AuthConfig.Builder onlineBuilder, EchoConfig echoConfig) {
DUILiteSDK.init(mContext, new DUILiteConfig.Builder()
.setApiKey("113cc31f6385113cc31f6385618c86f5")
.setProductId("278586132")
.setProductKey("1fe5930844b488a8d32d9ef7717be7dc")
.setProductSecret("f601ecc407986b548ac8ab2a9144162e")
.setAuthConfig(onlineBuilder.create())//授权配置
// .setRecorderConfig(recorderConfig)//设置录音配置
// .setUploadConfig(uploadConfig)//设置日志上传配置
// .setTtsCacheDir("/sdcard/speech/cache") //设置tts cache文件存放目录
.setEchoConfig(echoConfig)
.create(), new DUILiteSDK.InitListener() {
@Override
public void success() {
CallerLogger.INSTANCE.d(TAG, "授权成功");
ThreadUtils.runOnUiThread(() -> {
mHasAuth = true;
initTtsEngine();
});
}
@Override
public void error(String errorCode, final String errorInfo) {
CallerLogger.INSTANCE.e(TAG, "error code : " + errorCode + " , error info :" + errorInfo);
if (retryCount++ < 3) {
initDUILiteSDK(onlineBuilder, echoConfig);
}
// throw new IllegalStateException("授权失败,请检查授权配置");
}
});
// boolean isAuthorized = DUILiteSDK.isAuthorized(mContext);//查询授权状态DUILiteSDK.init之后随时可以调
// CallerLogger.INSTANCE.d(TAG, "DUILite SDK is isAuthorized " + isAuthorized);
//
// String core_version = DUILiteSDK.getCoreVersion();//获取内核版本号
// CallerLogger.INSTANCE.d(TAG, "core version is: " + core_version);
}
private void initTtsEngine() {
CallerLogger.INSTANCE.d(TAG, "initTtsEngine");
if (mEngine != null) {
@@ -427,7 +434,7 @@ public class PadTTS implements IMogoTTS, VoiceClient.VoiceCmdCallBack, OnTtsList
@MainThread
public void speakTTSVoiceWithLevel(String text, int ttsLevel, IMogoTTSCallback callBack) {
if (mHasFlush && mEngine != null) {
if (mHasAuth && mEngine != null) {
mSpeakVoiceMap.put(text, callBack);
}
speakTTSVoiceWithLevel(text, ttsLevel);