[2.13.0] merge 2.13.0 branch
This commit is contained in:
@@ -245,8 +245,6 @@ public class BusPassengerModel {
|
||||
}
|
||||
|
||||
private void initListeners() {
|
||||
MogoAiCloudSocketManager.getInstance(mContext)
|
||||
.registerLifecycleListener(10010, mSocketLifeCycleLisnter);
|
||||
|
||||
// 2021.11.1重构自动驾驶 实现接口 IMoGoAutopilotStatusListener 注册监听 替换IMogoAdasOCHCallback接口
|
||||
CallerAutoPilotStatusListenerManager.INSTANCE.addListener(TAG, mGoAutopilotStatusListener);
|
||||
@@ -302,17 +300,6 @@ public class BusPassengerModel {
|
||||
}
|
||||
};
|
||||
|
||||
private final IMogoLifecycleListener mSocketLifeCycleLisnter = new IMogoLifecycleListener() {
|
||||
@Override
|
||||
public void onConnectFailure() { CallerLogger.INSTANCE.e(M_BUS_P + TAG,"socket onConnectFailure"); }
|
||||
|
||||
@Override
|
||||
public void onConnectSuccess() { CallerLogger.INSTANCE.e(M_BUS_P + TAG,"socket onConnectSuccess"); }
|
||||
|
||||
@Override
|
||||
public void onConnectLost() { CallerLogger.INSTANCE.e(M_BUS_P + TAG,"socket onConnectLost"); }
|
||||
};
|
||||
|
||||
// 自车定位
|
||||
private final IMogoCarLocationChangedListener2 mCarLocationChangedListener2 = new IMogoCarLocationChangedListener2() {
|
||||
|
||||
|
||||
@@ -15,6 +15,7 @@ import androidx.annotation.NonNull;
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.amap.api.maps.model.LatLng;
|
||||
import com.elegant.network.utils.GsonUtil;
|
||||
import com.mogo.aicloud.services.socket.IMogoOnMessageListener;
|
||||
import com.mogo.cloud.commons.utils.CoordinateUtils;
|
||||
import com.mogo.commons.AbsMogoApplication;
|
||||
import com.mogo.commons.debug.DebugConfig;
|
||||
@@ -54,6 +55,8 @@ import com.mogo.och.bus.presenter.BusModelLoopManager;
|
||||
import com.mogo.och.bus.util.BusAnalyticsManager;
|
||||
import com.mogo.och.bus.util.BusSendTripInfoManager;
|
||||
import com.mogo.och.bus.util.BusTrajectoryManager;
|
||||
import com.mogo.och.common.module.biz.common.socketmessage.OCHSocketMessageManager;
|
||||
import com.mogo.och.common.module.biz.common.socketmessage.data.OCHOperationalMessage;
|
||||
import com.mogo.och.common.module.biz.constant.OchCommonConst;
|
||||
import com.mogo.och.common.module.biz.network.OchCommonServiceCallback;
|
||||
import com.mogo.och.common.module.biz.provider.LoginService;
|
||||
@@ -163,6 +166,10 @@ public class BusOrderModel {
|
||||
|
||||
//开启自驾后 异常信息返回
|
||||
OCHAdasAbilityManager.getInstance().setAdasStartFailureCallback(mAdasStartFailureListener);
|
||||
|
||||
OCHSocketMessageManager.INSTANCE.registerSocketMessageListener(
|
||||
OCHSocketMessageManager.INSTANCE.getMsgMonitorType(),
|
||||
mMogoOnMessageListener);
|
||||
}
|
||||
|
||||
//2022.1.28
|
||||
@@ -203,6 +210,19 @@ public class BusOrderModel {
|
||||
});
|
||||
}
|
||||
|
||||
private final IMogoOnMessageListener<OCHOperationalMessage> mMogoOnMessageListener =
|
||||
new IMogoOnMessageListener<OCHOperationalMessage>() {
|
||||
@Override
|
||||
public Class<OCHOperationalMessage> target() {
|
||||
return OCHOperationalMessage.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onMsgReceived(OCHOperationalMessage obj) {
|
||||
//todo 塞入消息盒子
|
||||
}
|
||||
};
|
||||
|
||||
public void setAdasStatusCallback(IBusADASStatusCallback callback){
|
||||
this.mADASStatusCallback = callback;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.mogo.och.common.module.biz.common.socketmessage
|
||||
|
||||
import android.icu.lang.UCharacter.GraphemeClusterBreak.T
|
||||
import com.mogo.aicloud.services.socket.IMogoOnMessageListener
|
||||
import com.mogo.aicloud.services.socket.MogoAiCloudSocketManager
|
||||
import com.mogo.commons.AbsMogoApplication
|
||||
import com.mogo.och.common.module.biz.common.socketmessage.data.OCHOperationalMessage
|
||||
|
||||
/**
|
||||
* 统一管理业务长链消息推送
|
||||
*/
|
||||
object OCHSocketMessageManager {
|
||||
public val msgMonitorType:Int = 0X0601001
|
||||
public val msgWriteOffPassengerType:Int = 0X0601002
|
||||
|
||||
fun registerSocketMessageListener(msgType:Int,
|
||||
mogoOnMessageListener : IMogoOnMessageListener<OCHOperationalMessage>){
|
||||
MogoAiCloudSocketManager.getInstance(AbsMogoApplication.getApp().applicationContext)
|
||||
.registerOnMessageListener(msgType,mogoOnMessageListener)
|
||||
}
|
||||
|
||||
fun releaseSocketMessageListener(msgType:Int){
|
||||
MogoAiCloudSocketManager.getInstance(AbsMogoApplication.getApp().applicationContext)
|
||||
.unregisterLifecycleListener(msgType)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
package com.mogo.och.common.module.biz.common.socketmessage.data
|
||||
|
||||
/**
|
||||
* 运营消息data类
|
||||
*/
|
||||
data class OCHOperationalMessage (
|
||||
var message: String = "" ,//运营消息
|
||||
var messageType: Int = 0, // 运营消息类型
|
||||
var pushTimeStamp: Long = System.currentTimeMillis() // 消息下发时间戳
|
||||
)
|
||||
@@ -226,8 +226,6 @@ public class TaxiPassengerModel implements IOCHTaxiPassengerNaviChangedCallback
|
||||
}
|
||||
|
||||
private void initListeners() {
|
||||
MogoAiCloudSocketManager.getInstance(mContext)
|
||||
.registerLifecycleListener(10010,mSocketLifeCycleLisnter);
|
||||
|
||||
// 2021.11.1重构自动驾驶 实现接口 IMoGoAutopilotStatusListener 注册监听 替换IMogoAdasOCHCallback接口
|
||||
CallerAutoPilotStatusListenerManager.INSTANCE.addListener(TAG, mGoAutopilotStatusListener);
|
||||
@@ -469,17 +467,6 @@ public class TaxiPassengerModel implements IOCHTaxiPassengerNaviChangedCallback
|
||||
}
|
||||
};
|
||||
|
||||
private final IMogoLifecycleListener mSocketLifeCycleLisnter = new IMogoLifecycleListener() {
|
||||
@Override
|
||||
public void onConnectFailure() { CallerLogger.INSTANCE.e(M_TAXI_P + TAG,"socket onConnectFailure"); }
|
||||
|
||||
@Override
|
||||
public void onConnectSuccess() { CallerLogger.INSTANCE.e(M_TAXI_P + TAG,"socket onConnectSuccess"); }
|
||||
|
||||
@Override
|
||||
public void onConnectLost() { CallerLogger.INSTANCE.e(M_TAXI_P + TAG,"socket onConnectLost"); }
|
||||
};
|
||||
|
||||
// 自车定位
|
||||
private final IMogoCarLocationChangedListener2 mCarLocationChangedListener2 = new IMogoCarLocationChangedListener2() {
|
||||
|
||||
|
||||
@@ -12,6 +12,7 @@ package com.mogo.och.taxi.constant
|
||||
* 身体不适 3
|
||||
* 乘客未到 4
|
||||
* 乘客中途下车 5
|
||||
* 1099前都可用
|
||||
*
|
||||
* 待服务订单:
|
||||
* 2000 车辆故障
|
||||
@@ -27,6 +28,11 @@ enum class TaxiOrderCancelReasons(val type: Int, val msg: String) {
|
||||
DriverIsIll(1003, "身体不适"),
|
||||
PassengerNotArrive(1004, "乘客未到"),
|
||||
PassengerStopOver(1005, "乘客中途下车"),
|
||||
PassengerCancel(1006, "乘客联系安全员取消"),
|
||||
UnContractPassenger(1007, "联系不上乘客"),
|
||||
JourneyConflict(1008, "行程冲突"),
|
||||
StartStationFaraway(1009,"距离过远 无法接单"),
|
||||
Other( 1010, "其他原因"),
|
||||
|
||||
BookCarBroken(2000, "车辆故障"),
|
||||
BookPassengerCancel(2001, "乘客联系取消"),
|
||||
|
||||
@@ -16,7 +16,7 @@ import androidx.annotation.Nullable;
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.amap.api.maps.model.LatLng;
|
||||
import com.elegant.network.utils.GsonUtil;
|
||||
import com.mogo.aicloud.services.socket.MogoAiCloudSocketManager;
|
||||
import com.mogo.aicloud.services.socket.IMogoOnMessageListener;
|
||||
import com.mogo.cloud.commons.utils.CoordinateUtils;
|
||||
import com.mogo.commons.module.intent.IMogoIntentListener;
|
||||
import com.mogo.commons.module.intent.IntentManager;
|
||||
@@ -39,6 +39,8 @@ import com.mogo.eagle.core.utilcode.util.ToastUtils;
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler;
|
||||
import com.mogo.map.navi.IMogoCarLocationChangedListener2;
|
||||
import com.mogo.module.common.MogoApisHandler;
|
||||
import com.mogo.och.common.module.biz.common.socketmessage.OCHSocketMessageManager;
|
||||
import com.mogo.och.common.module.biz.common.socketmessage.data.OCHOperationalMessage;
|
||||
import com.mogo.och.common.module.biz.constant.LoginStatusManager;
|
||||
import com.mogo.och.common.module.biz.constant.OchCommonConst;
|
||||
import com.mogo.och.common.module.biz.network.OchCommonServiceCallback;
|
||||
@@ -212,9 +214,6 @@ public class TaxiModel {
|
||||
}
|
||||
|
||||
private void initListeners() {
|
||||
MogoAiCloudSocketManager.getInstance(mContext)
|
||||
.registerLifecycleListener(10010, mSocketLifeCycleLisnter);
|
||||
|
||||
// 2021.11.1重构自动驾驶 实现接口 IMoGoAutopilotStatusListener 注册监听 替换IMogoAdasOCHCallback接口
|
||||
CallerAutoPilotStatusListenerManager.INSTANCE.addListener(TAG, mGoAutopilotStatusListener);
|
||||
IntentManager.getInstance().registerIntentListener(ConnectivityManager.CONNECTIVITY_ACTION, mNetWorkIntentListener);
|
||||
@@ -230,8 +229,25 @@ public class TaxiModel {
|
||||
|
||||
//开启自驾后 异常信息返回
|
||||
OCHAdasAbilityManager.getInstance().setAdasStartFailureCallback(mAdasStartFailureListener);
|
||||
|
||||
OCHSocketMessageManager.INSTANCE.registerSocketMessageListener(
|
||||
OCHSocketMessageManager.INSTANCE.getMsgMonitorType(),
|
||||
mMogoOnMessageListener);
|
||||
}
|
||||
|
||||
private final IMogoOnMessageListener<OCHOperationalMessage> mMogoOnMessageListener =
|
||||
new IMogoOnMessageListener<OCHOperationalMessage>() {
|
||||
@Override
|
||||
public Class<OCHOperationalMessage> target() {
|
||||
return OCHOperationalMessage.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onMsgReceived(OCHOperationalMessage obj) {
|
||||
//todo 塞入消息盒子
|
||||
}
|
||||
};
|
||||
|
||||
private void releaseListeners() {
|
||||
MogoStatusManager.getInstance().unregisterStatusChangedListener(TAG, StatusDescriptor.VR_MODE, mMogoStatusChangedListener);
|
||||
|
||||
@@ -241,8 +257,7 @@ public class TaxiModel {
|
||||
.getRegisterCenterApi()
|
||||
.unregisterCarLocationChangedListener(TAG, mCarLocationChangedListener2);
|
||||
|
||||
MogoAiCloudSocketManager.getInstance(mContext)
|
||||
.unregisterLifecycleListener(10010);
|
||||
OCHSocketMessageManager.INSTANCE.releaseSocketMessageListener(OCHSocketMessageManager.INSTANCE.getMsgMonitorType());
|
||||
|
||||
CallerAutoPilotStatusListenerManager.INSTANCE.removeListener(mGoAutopilotStatusListener);
|
||||
CallerAutopilotPlanningListenerManager.INSTANCE.removeListener(moGoAutopilotPlanningListener);
|
||||
@@ -1027,23 +1042,6 @@ public class TaxiModel {
|
||||
}
|
||||
};
|
||||
|
||||
private final IMogoLifecycleListener mSocketLifeCycleLisnter = new IMogoLifecycleListener() {
|
||||
@Override
|
||||
public void onConnectFailure() {
|
||||
CallerLogger.INSTANCE.e(M_TAXI + TAG, "socket onConnectFailure");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onConnectSuccess() {
|
||||
CallerLogger.INSTANCE.e(M_TAXI + TAG, "socket onConnectSuccess");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onConnectLost() {
|
||||
CallerLogger.INSTANCE.e(M_TAXI + TAG, "socket onConnectLost");
|
||||
}
|
||||
};
|
||||
|
||||
// 自车定位
|
||||
private final IMogoCarLocationChangedListener2 mCarLocationChangedListener2 = new IMogoCarLocationChangedListener2() {
|
||||
|
||||
|
||||
@@ -191,6 +191,11 @@ public class TaxiPresenter extends Presenter<TaxiFragment> implements ITaxiADASS
|
||||
public void reportToEndDisAndTime(long lastSumLength, long duration){//米/秒
|
||||
TaxiModel.getInstance().reportOrderRemain(lastSumLength,duration);
|
||||
}
|
||||
|
||||
public void closeOrderByMan(){
|
||||
TaxiModel.getInstance().arriveTerminal();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAutopilotArriveEnd() {
|
||||
|
||||
|
||||
@@ -404,7 +404,7 @@ public abstract class BaseTaxiTabFragment<V extends IView, P extends Presenter<V
|
||||
mAnimFlowIv.setImageResource(0);
|
||||
}
|
||||
|
||||
ctvAutopilotStatusRL.setBackground(getResources().getDrawable(R.drawable.taxi_autopilot_bg_selector));
|
||||
// ctvAutopilotStatusRL.setBackground(getResources().getDrawable(R.drawable.taxi_autopilot_bg_selector));
|
||||
animatorDrawableUtil = null;
|
||||
} else if (IMoGoAutopilotStatusListener.STATUS_PARALLEL_DRIVING == status){
|
||||
mAutopilotTv.setText("远程代驾");
|
||||
@@ -425,7 +425,7 @@ public abstract class BaseTaxiTabFragment<V extends IView, P extends Presenter<V
|
||||
mAnimFlowIv.setImageResource(0);
|
||||
}
|
||||
|
||||
ctvAutopilotStatusRL.setBackground(getResources().getDrawable(R.drawable.taxi_ic_autopilot_bg));
|
||||
// ctvAutopilotStatusRL.setBackground(getResources().getDrawable(R.drawable.taxi_ic_autopilot_bg));
|
||||
animatorDrawableUtil = null;
|
||||
}
|
||||
|
||||
|
||||
@@ -34,6 +34,7 @@ import com.mogo.och.common.module.utils.DateTimeUtil;
|
||||
import com.mogo.och.common.module.utils.NumberFormatUtil;
|
||||
import com.mogo.och.common.module.utils.OCHThreadPoolManager;
|
||||
import com.mogo.och.common.module.voice.VoiceNotice;
|
||||
import com.mogo.och.common.module.wigets.OCHCommitDialog;
|
||||
import com.mogo.och.taxi.constant.TaxiConst;
|
||||
import com.mogo.och.taxi.constant.TaxiOrderStatusEnum;
|
||||
import com.mogo.och.taxi.R;
|
||||
@@ -218,11 +219,10 @@ public class TaxiBeingServerdOrdersFragment extends BaseTaxiUIFragment
|
||||
mContentModule2.setVisibility(View.VISIBLE);
|
||||
mOrderStatus.setText(R.string.module_och_taxi_on_the_way_2_end_station);
|
||||
|
||||
updateOrderBottomBtn(getString(R.string.module_och_taxi_order_server_end),
|
||||
Color.parseColor("#4DFFFFFF"),
|
||||
Color.parseColor("#4D1D5EF3"),
|
||||
false);
|
||||
|
||||
updateOrderBottomBtn(getString(R.string.module_och_taxi_order_close),
|
||||
Color.parseColor("#FFFFFF"),
|
||||
Color.parseColor("#FF1D5EF3"),
|
||||
true);
|
||||
mTitleTV2.setText("送乘客至");
|
||||
mStationTv2.setText(order.endSiteAddr);
|
||||
} else if (TaxiOrderStatusEnum.UserArriveAtStart.getCode() == order.orderStatus
|
||||
@@ -450,9 +450,33 @@ public class TaxiBeingServerdOrdersFragment extends BaseTaxiUIFragment
|
||||
}else if (TaxiOrderStatusEnum.ArriveAtEnd.getCode() == mCurrentOrder.orderStatus) {//点击了完成服务,结束订单并更新订单信息
|
||||
mTaxiFragment.completeOrderService();
|
||||
//VoiceNotice.showNotice(getResources().getString(R.string.module_och_taxi_order_server_completed_tip));
|
||||
}else if (TaxiOrderStatusEnum.OnTheWayToEnd.getCode() == mCurrentOrder.orderStatus){//前往目的地过程中可提前结束行程
|
||||
closeOrderDialog();
|
||||
}
|
||||
}
|
||||
|
||||
private void closeOrderDialog() {
|
||||
OCHCommitDialog.Builder builder = new OCHCommitDialog.Builder();
|
||||
OCHCommitDialog closeOrderDialog = builder
|
||||
.title(getString(R.string.dialog_order_close_title))
|
||||
.tips(getString(R.string.dialog_order_close_content))
|
||||
.confirmStr(getString(R.string.dialog_order_close_confirm))
|
||||
.cancelStr(getString(R.string.dialog_order_close_cancel))
|
||||
.build(getContext());
|
||||
closeOrderDialog.setClickListener(new OCHCommitDialog.ClickListener() {
|
||||
@Override
|
||||
public void confirm() {
|
||||
if (mTaxiFragment != null) mTaxiFragment.closeOrderByMan();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void cancel() {
|
||||
closeOrderDialog.dismiss();
|
||||
}
|
||||
});
|
||||
closeOrderDialog.show();
|
||||
}
|
||||
|
||||
public void onOrderStatusChanged(OrderQueryRespBean.Result order) {
|
||||
int status = order.orderStatus;
|
||||
CallerLogger.INSTANCE.d(M_TAXI + TAG, "status==" + status);
|
||||
|
||||
@@ -319,6 +319,10 @@ public class TaxiFragment extends BaseTaxiTabFragment<TaxiFragment, TaxiPresente
|
||||
}
|
||||
}
|
||||
|
||||
public void closeOrderByMan(){
|
||||
mPresenter.closeOrderByMan();
|
||||
}
|
||||
|
||||
/**
|
||||
* 高德计算出来的到达目的地的剩余里程和时间
|
||||
* @param meters
|
||||
|
||||
@@ -65,22 +65,27 @@ public class TaxiOrderCancelDialog extends AlertDialog implements View.OnClickLi
|
||||
switch (ochStatus) {
|
||||
case OnTheWayToStart:
|
||||
mContentArrays = new String[]{TaxiOrderCancelReasons.CarBroken.getMsg(), TaxiOrderCancelReasons.DeviceBroken.getMsg(),
|
||||
TaxiOrderCancelReasons.BatteryLow.getMsg(), TaxiOrderCancelReasons.DriverIsIll.getMsg()};
|
||||
TaxiOrderCancelReasons.BatteryLow.getMsg(), TaxiOrderCancelReasons.DriverIsIll.getMsg(),
|
||||
TaxiOrderCancelReasons.StartStationFaraway.getMsg(), TaxiOrderCancelReasons.Other.getMsg(),
|
||||
TaxiOrderCancelReasons.PassengerCancel.getMsg()};
|
||||
break;
|
||||
case ArriveAtStart:
|
||||
mContentArrays = new String[]{TaxiOrderCancelReasons.CarBroken.getMsg(), TaxiOrderCancelReasons.DeviceBroken.getMsg(),
|
||||
TaxiOrderCancelReasons.BatteryLow.getMsg(), TaxiOrderCancelReasons.DriverIsIll.getMsg(),
|
||||
TaxiOrderCancelReasons.PassengerNotArrive.getMsg()};
|
||||
TaxiOrderCancelReasons.PassengerNotArrive.getMsg(),TaxiOrderCancelReasons.UnContractPassenger.getMsg(),
|
||||
TaxiOrderCancelReasons.PassengerCancel.getMsg(),TaxiOrderCancelReasons.Other.getMsg()};
|
||||
break;
|
||||
case OnTheWayToEnd:
|
||||
case ArriveAtEnd:
|
||||
mContentArrays = new String[]{TaxiOrderCancelReasons.CarBroken.getMsg(), TaxiOrderCancelReasons.DeviceBroken.getMsg(),
|
||||
TaxiOrderCancelReasons.BatteryLow.getMsg(), TaxiOrderCancelReasons.DriverIsIll.getMsg(), TaxiOrderCancelReasons.PassengerStopOver.getMsg()};
|
||||
TaxiOrderCancelReasons.BatteryLow.getMsg(), TaxiOrderCancelReasons.DriverIsIll.getMsg(),
|
||||
TaxiOrderCancelReasons.PassengerStopOver.getMsg(),TaxiOrderCancelReasons.Other.getMsg()};
|
||||
break;
|
||||
default:
|
||||
mContentArrays = new String[]{TaxiOrderCancelReasons.CarBroken.getMsg(), TaxiOrderCancelReasons.DeviceBroken.getMsg(),
|
||||
TaxiOrderCancelReasons.BatteryLow.getMsg(), TaxiOrderCancelReasons.DriverIsIll.getMsg(),
|
||||
TaxiOrderCancelReasons.PassengerNotArrive.getMsg(), TaxiOrderCancelReasons.PassengerStopOver.getMsg()};
|
||||
TaxiOrderCancelReasons.PassengerNotArrive.getMsg(), TaxiOrderCancelReasons.PassengerStopOver.getMsg(),
|
||||
TaxiOrderCancelReasons.Other.getMsg()};
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:tools="http://schemas.android.com/tools" xmlns:android="http://schemas.android.com/apk/res/android" tools:ignore="MissingDefaultResource">
|
||||
<item android:drawable="@drawable/taxi_ic_autopilot_bg_pressed" android:state_pressed="true"/>
|
||||
|
||||
<item android:state_pressed="true" android:drawable="@drawable/taxi_ic_autopilot_bg_pressed"/>
|
||||
<item android:state_pressed="false" android:drawable="@drawable/taxi_ic_autopilot_bg" />
|
||||
<item android:drawable="@drawable/taxi_ic_autopilot_bg"/>
|
||||
</selector>
|
||||
@@ -1,5 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:tools="http://schemas.android.com/tools" xmlns:android="http://schemas.android.com/apk/res/android" tools:ignore="MissingDefaultResource">
|
||||
<item android:drawable="@drawable/taxi_ic_autopilot_bg_pressed" android:state_pressed="true"/>
|
||||
<item android:drawable="@drawable/taxi_ic_autopilot_bg"/>
|
||||
</selector>
|
||||
@@ -21,6 +21,13 @@
|
||||
<string name="module_och_taxi_order_server_wait_passenger_start">等待乘客开始行程</string>
|
||||
<string name="module_och_taxi_order_choose_start_autopilot_tip">请等待乘客启动自动驾驶,或您自行启动</string>
|
||||
<string name="module_och_taxi_order_server_end">服务完成</string>
|
||||
<string name="module_och_taxi_order_close">结束行程</string>
|
||||
|
||||
<string name="dialog_order_close_title">提示</string>
|
||||
<string name="dialog_order_close_content">您确认要结束行程吗</string>
|
||||
<string name="dialog_order_close_confirm">确认</string>
|
||||
<string name="dialog_order_close_cancel">取消</string>
|
||||
|
||||
|
||||
<string name="module_och_taxi_auto_disable_tip">自动驾驶状态为0不可用</string>
|
||||
<string name="module_och_taxi_auto_disable_tip1">司机端未确认可以开启自动驾驶</string>
|
||||
|
||||
@@ -35,6 +35,7 @@ class ConfigStartUp : AndroidStartup<Boolean>() {
|
||||
appBuildTime = BuildConfig.APP_BUILD_TIME
|
||||
// 使用与渠道配置一样的gps提供者提供的数据,app/productFlavors/fPadLenovo.gradle GPS_PROVIDER 0-Android系统,1-工控机,2-OBU
|
||||
FunctionBuildConfig.gpsProvider = BuildConfig.GPS_PROVIDER
|
||||
// FunctionBuildConfig.gpsProvider = 2
|
||||
// 演示模式,上一次勾选的数据
|
||||
FunctionBuildConfig.isDemoMode = BuildConfig.IS_DEMO_MODE
|
||||
// app安装的身份信息
|
||||
|
||||
@@ -96,7 +96,8 @@ ext {
|
||||
|
||||
// obu sdk
|
||||
obusdk : "com.zhidao.enterprise.smartv2x:smartv2x:1.0.0.3",
|
||||
mogoobu : 'com.zhidao.support.obu:mogoobu:1.0.0.33',
|
||||
mogoobuold : 'com.zhidao.support.obu:mogoobu:1.0.0.33',
|
||||
mogoobu : 'com.mogo.support.obu:mogo-obu:1.0.1',
|
||||
mogoami : 'com.zhidao.support.obu.ami:mogoami:1.0.0.24',
|
||||
|
||||
// google
|
||||
|
||||
@@ -5,6 +5,7 @@ import android.util.Log
|
||||
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsListenerManager
|
||||
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsUpgradeListenerManager
|
||||
import com.mogo.eagle.core.utilcode.breakpoint.Config
|
||||
import com.mogo.eagle.core.utilcode.breakpoint.Config.DOWN_LOAD_TAG
|
||||
import com.mogo.eagle.core.utilcode.breakpoint.bean.ThreadBean
|
||||
import com.mogo.eagle.core.utilcode.breakpoint.callback.IDownload
|
||||
import com.mogo.eagle.core.utilcode.breakpoint.utils.DownloadUtils
|
||||
@@ -54,22 +55,40 @@ class UpgradeManager : IDownload {
|
||||
|
||||
override fun onStart(downloadUrl: String?) {
|
||||
CallerLogger.d("$M_DEVA$TAG","onStart downloadUrl : $downloadUrl")
|
||||
findKey(downloadUrl) {
|
||||
CallerDevaToolsUpgradeListenerManager.invokeUpgradeStart(it)
|
||||
if (downloadUrl != null) {
|
||||
if (map.isNullOrEmpty()) {
|
||||
CallerDevaToolsUpgradeListenerManager.invokeUpgradeStart(downloadUrl)
|
||||
} else {
|
||||
findKey(downloadUrl) {
|
||||
CallerDevaToolsUpgradeListenerManager.invokeUpgradeStart(it)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun onPause(downloadUrl: String?, threadBean: ThreadBean?) {
|
||||
CallerLogger.d("$M_DEVA$TAG","onPause downloadUrl : $downloadUrl , threadBean : $threadBean")
|
||||
findKey(downloadUrl) {
|
||||
CallerDevaToolsUpgradeListenerManager.invokeUpgradePause(it)
|
||||
if (downloadUrl != null) {
|
||||
if (map.isNullOrEmpty()) {
|
||||
CallerDevaToolsUpgradeListenerManager.invokeUpgradePause(downloadUrl)
|
||||
} else {
|
||||
findKey(downloadUrl) {
|
||||
CallerDevaToolsUpgradeListenerManager.invokeUpgradePause(it)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun onProgress(downloadUrl: String?, length: Int) {
|
||||
CallerLogger.d("$M_DEVA$TAG","onProgress downloadUrl : $downloadUrl , length : $length")
|
||||
findKey(downloadUrl) {
|
||||
CallerDevaToolsUpgradeListenerManager.invokeUpgradeProgress(it, length)
|
||||
CallerLogger.d("$M_DEVA$TAG"," onProgress downloadUrl : $downloadUrl , length : $length")
|
||||
if (downloadUrl != null) {
|
||||
if (map.isNullOrEmpty()) {
|
||||
CallerDevaToolsUpgradeListenerManager.invokeUpgradeProgress(downloadUrl, length)
|
||||
} else {
|
||||
findKey(downloadUrl) {
|
||||
CallerDevaToolsUpgradeListenerManager.invokeUpgradeProgress(downloadUrl, length)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -77,15 +96,27 @@ class UpgradeManager : IDownload {
|
||||
if (downloadUrl != null) {
|
||||
AppUtils.installApp(Config.downLoadPath + downloadUrl.substring(downloadUrl.lastIndexOf("/") + 1))
|
||||
}
|
||||
findKey(downloadUrl) {
|
||||
CallerDevaToolsUpgradeListenerManager.invokeUpgradeFinish(it)
|
||||
if (downloadUrl != null) {
|
||||
if (map.isNullOrEmpty()) {
|
||||
CallerDevaToolsUpgradeListenerManager.invokeUpgradeFinish(downloadUrl)
|
||||
} else {
|
||||
findKey(downloadUrl) {
|
||||
CallerDevaToolsUpgradeListenerManager.invokeUpgradeFinish(it)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun onError(downloadUrl: String?, errorMsg: String?) {
|
||||
CallerLogger.d("$M_DEVA$TAG","onError downloadUrl : $downloadUrl , errorMsg : $errorMsg")
|
||||
findKey(downloadUrl) {
|
||||
CallerDevaToolsUpgradeListenerManager.invokeUpgradeError(it, errorMsg ?: "未知错误")
|
||||
if (downloadUrl != null) {
|
||||
if (map.isNullOrEmpty()) {
|
||||
CallerDevaToolsUpgradeListenerManager.invokeUpgradeError(downloadUrl, errorMsg ?: "未知错误")
|
||||
} else {
|
||||
findKey(downloadUrl) {
|
||||
CallerDevaToolsUpgradeListenerManager.invokeUpgradeError(it, errorMsg ?: "未知错误")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -242,10 +242,10 @@ class MoGoHmiFragment : MvpFragment<MoGoHmiContract.View?, HmiPresenter?>(),
|
||||
if (AppConfigInfo.uniqueDeviceId.isNullOrEmpty()) {
|
||||
AppConfigInfo.uniqueDeviceId = DeviceIdUtils.getDeviceId(AbsMogoApplication.getApp())
|
||||
}
|
||||
if (AppConfigInfo.widevineIDMd5.isNullOrEmpty()) {
|
||||
AppConfigInfo.widevineIDMd5 =
|
||||
DeviceIdUtils.getWidevineIDWithMd5(AbsMogoApplication.getApp())
|
||||
}
|
||||
// if (AppConfigInfo.widevineIDMd5.isNullOrEmpty()) {
|
||||
// AppConfigInfo.widevineIDMd5 =
|
||||
// DeviceIdUtils.getWidevineIDWithMd5(AbsMogoApplication.getApp())
|
||||
// }
|
||||
if (MoGoAiCloudClient.getInstance().aiCloudClientConfig != null) {
|
||||
AppConfigInfo.mogoSN = MoGoAiCloudClient.getInstance().aiCloudClientConfig.sn
|
||||
AppConfigInfo.mogoToken = MoGoAiCloudClient.getInstance().aiCloudClientConfig.token
|
||||
@@ -999,7 +999,9 @@ class MoGoHmiFragment : MvpFragment<MoGoHmiContract.View?, HmiPresenter?>(),
|
||||
override fun showWarning(direction: WarningDirectionEnum) {
|
||||
CallerLogger.d(TAG, "showWarning====")
|
||||
flV2XWarningView?.showWarning(direction)
|
||||
flicker(flV2XWarningView)
|
||||
if (flV2XWarningView != null) {
|
||||
flicker(flV2XWarningView)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -54,7 +54,7 @@ class UpgradeAppDialog(context: Context) : BaseFloatDialog(context), LifecycleOb
|
||||
* 去下载
|
||||
*/
|
||||
fun downloadApp() {
|
||||
ToastUtils.showLong("开始下载APK,稍后可前往downloads文件夹查看")
|
||||
ToastUtils.showLong("开始下载APK,稍后可前往downloads文件夹查看,通知栏查看下载进度")
|
||||
tag?.let { downloarUrl?.let { it1 -> CallerDevaToolsManager.downLoadPackage(it, it1) } }
|
||||
|
||||
dismiss()
|
||||
|
||||
@@ -1,19 +1,24 @@
|
||||
package com.mogo.eagle.core.function.hmi.ui.widget
|
||||
|
||||
import android.app.NotificationManager
|
||||
import android.content.Context
|
||||
import android.util.AttributeSet
|
||||
import android.util.Log
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import com.mogo.cloud.passport.MoGoAiCloudClientConfig
|
||||
import androidx.core.app.NotificationCompat
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotStatusInfo
|
||||
import com.mogo.eagle.core.data.bindingcar.AdUpgradeStateHelper
|
||||
import com.mogo.eagle.core.data.bindingcar.IPCUpgradeStateInfo
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener
|
||||
import com.mogo.eagle.core.function.api.bindingcar.IMoGoBindingCarListener
|
||||
import com.mogo.eagle.core.function.api.devatools.IMogoDevaToolsUpgradeListener
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager
|
||||
import com.mogo.eagle.core.function.call.bindingcar.CallerBindingCarListenerManager
|
||||
import com.mogo.eagle.core.function.call.bindingcar.CallerBindingcarManager
|
||||
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsUpgradeListenerManager
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager.showUpgradeDialog
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_HMI
|
||||
@@ -23,6 +28,7 @@ import com.mogo.eagle.core.utilcode.util.ToastUtils
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
|
||||
import kotlinx.android.synthetic.main.view_system_version.view.*
|
||||
|
||||
|
||||
/**
|
||||
* @author XuXinChao
|
||||
* @description 工具箱-系统版本(鹰眼版本、工控机版本)视图
|
||||
@@ -57,10 +63,64 @@ class SystemVersionView @JvmOverloads constructor(
|
||||
private fun initView() {
|
||||
showCurrentPadVersion()
|
||||
showCurrentAdVersion()
|
||||
|
||||
val builder = NotificationCompat.Builder(context)
|
||||
builder.setSmallIcon(R.mipmap.icon1001)
|
||||
builder.setContentTitle("下载")
|
||||
builder.setContentText("正在下载")
|
||||
val manager: NotificationManager? = context.getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager?
|
||||
|
||||
//鹰眼版本视图点击事件
|
||||
ivPadVersion.setOnClickListener {
|
||||
CallerLogger.i("$M_HMI$$TAG", "pad version view clicked")
|
||||
CallerBindingcarManager.getBindingcarProvider().queryAppUpgrade()
|
||||
|
||||
// showUpgradeDialog(
|
||||
// "",
|
||||
// "",
|
||||
// "",
|
||||
// "",
|
||||
// "1"
|
||||
// )
|
||||
//
|
||||
// CallerDevaToolsUpgradeListenerManager.registerDevaToolsUpgradeListener(TAG,
|
||||
// object : IMogoDevaToolsUpgradeListener {
|
||||
// override fun onStart(url: String?) {
|
||||
// Log.d("Package-DownLoad", " SystemVersionView onStart --------> ")
|
||||
// }
|
||||
//
|
||||
// override fun onPause(url: String?) {
|
||||
//
|
||||
// }
|
||||
//
|
||||
// override fun onProgress(url: String?, length: Int) {
|
||||
// Log.d("Package-DownLoad", " SystemVersionView onProgress length = $length")
|
||||
// builder.setProgress(100, length,false)
|
||||
// manager?.notify(0x3,builder.build())
|
||||
// //下载进度提示
|
||||
// if (length == 99) {
|
||||
// UiThreadHandler.postDelayed({
|
||||
// length == 100
|
||||
// builder.setContentText("已下载" + length + "%")
|
||||
//
|
||||
// UiThreadHandler.postDelayed({
|
||||
// manager?.cancel(0x3)
|
||||
// }, 1000L)
|
||||
//
|
||||
// }, 1500L)
|
||||
// }
|
||||
//
|
||||
// builder.setContentText("已下载" + length + "%")
|
||||
// }
|
||||
//
|
||||
// override fun onFinished(url: String?) {
|
||||
// Log.d("Package-DownLoad", " SystemVersionView onFinished ------> ")
|
||||
// }
|
||||
//
|
||||
// override fun onError(url: String?, errorMsg: String?) {
|
||||
// Log.d("Package-DownLoad", " errorMsg = $errorMsg")
|
||||
// }
|
||||
// })
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -66,6 +66,7 @@ dependencies {
|
||||
implementation project(':core:mogo-core-function-call')
|
||||
}
|
||||
|
||||
implementation rootProject.ext.dependencies.mogoobuold
|
||||
implementation rootProject.ext.dependencies.mogoobu
|
||||
|
||||
}
|
||||
|
||||
@@ -26,6 +26,13 @@
|
||||
</intent-filter>
|
||||
</receiver>
|
||||
|
||||
<receiver android:name="com.mogo.eagle.core.function.obu.mogo.receiver.ObuTestNewObuReceiver">
|
||||
<intent-filter>
|
||||
<action android:name="com.obu.test_newobu" />
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
</intent-filter>
|
||||
</receiver>
|
||||
|
||||
</application>
|
||||
|
||||
</manifest>
|
||||
@@ -10,6 +10,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.logger.scene.SceneConstant.Companion.M_OBU
|
||||
import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr
|
||||
import com.mogo.eagle.core.utilcode.util.CommonUtils
|
||||
|
||||
/**
|
||||
* @author xiaoyuzhou
|
||||
@@ -21,6 +22,11 @@ class MoGoObuProvider : IMoGoObuProvider {
|
||||
|
||||
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
|
||||
|
||||
@@ -28,30 +34,72 @@ class MoGoObuProvider : IMoGoObuProvider {
|
||||
|
||||
}
|
||||
|
||||
|
||||
override fun init(context: Context) {
|
||||
CallerLogger.d("$M_OBU$TAG", "初始化蘑菇自研OBU……")
|
||||
if (AppIdentityModeUtils.isBus(FunctionBuildConfig.appIdentityMode) && AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode)) {
|
||||
CallerLogger.d("$M_OBU$TAG", "初始化蘑菇自研OBU…… localIp = " + CommonUtils.getLocalIPAddress())
|
||||
//bus乘客版本obu功能去掉
|
||||
if (AppIdentityModeUtils.isBus(FunctionBuildConfig.appIdentityMode) && AppIdentityModeUtils.isPassenger(
|
||||
FunctionBuildConfig.appIdentityMode
|
||||
)
|
||||
) {
|
||||
//不处理
|
||||
} else {
|
||||
mContext = context
|
||||
val ipAddress =
|
||||
SharedPrefsMgr.getInstance(context).getString(MoGoConfig.OBU_IP, "192.168.1.199")
|
||||
MogoPrivateObuManager.INSTANCE.init(context, ipAddress)
|
||||
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,
|
||||
CommonUtils.getIpAddressString()
|
||||
)
|
||||
|
||||
//old obu
|
||||
val ipAddress =
|
||||
SharedPrefsMgr.getInstance(context).getString(MoGoConfig.OBU_IP, taxiObuIp)
|
||||
MogoPrivateObuManager.INSTANCE.init(context, ipAddress)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过控制面板设置ip,进行传递
|
||||
*/
|
||||
override fun connect(ipAddress: String) {
|
||||
if (AppIdentityModeUtils.isBus(FunctionBuildConfig.appIdentityMode) && AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode)) {
|
||||
if (AppIdentityModeUtils.isBus(FunctionBuildConfig.appIdentityMode) && AppIdentityModeUtils.isPassenger(
|
||||
FunctionBuildConfig.appIdentityMode
|
||||
)
|
||||
) {
|
||||
//不处理
|
||||
} else {
|
||||
mContext?.let {
|
||||
// 保存本地OBU IP地址
|
||||
SharedPrefsMgr.getInstance(it).putString(MoGoConfig.OBU_IP, ipAddress)
|
||||
|
||||
//连接 mogo obu
|
||||
MogoPrivateObuNewManager.INSTANCE.connectObu(
|
||||
it,
|
||||
ipAddress,
|
||||
CommonUtils.getIpAddressString()
|
||||
)
|
||||
|
||||
//连接old obu
|
||||
MogoPrivateObuManager.INSTANCE.connectObu(it, ipAddress)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
override fun disConnect() {
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.mogo.eagle.core.function.obu.mogo
|
||||
|
||||
import android.content.Context
|
||||
import android.util.Log
|
||||
import com.alibaba.android.arouter.launcher.ARouter
|
||||
import com.mogo.cloud.passport.MoGoAiCloudClientConfig
|
||||
import com.mogo.eagle.core.data.app.AppConfigInfo
|
||||
@@ -51,6 +52,7 @@ class MogoPrivateObuManager private constructor() {
|
||||
mMogoServiceApis = ARouter.getInstance().build(MogoServicePaths.PATH_SERVICE_APIS)
|
||||
.navigation(context) as IMogoServiceApis
|
||||
mContext = context
|
||||
//连接obu设备
|
||||
connectObu(context, ipAddress)
|
||||
//控制日志输出
|
||||
MogoObuManager.getInstance()
|
||||
@@ -62,17 +64,16 @@ class MogoPrivateObuManager private constructor() {
|
||||
//自研obu初始化
|
||||
mObuStatusInfo.connectIP = ipAddress
|
||||
mObuStatusInfo.obuSdkVersion = MogoObuManager.getInstance().versionName
|
||||
|
||||
if (!MogoObuManager.getInstance().isConnected) {
|
||||
MogoObuManager.getInstance().connect(context, mObuStatusInfo.connectIP)
|
||||
} else {
|
||||
MogoObuManager.getInstance().disConnect()
|
||||
try {
|
||||
MogoObuManager.getInstance().disConnect()
|
||||
Thread.sleep(500)
|
||||
MogoObuManager.getInstance().connect(context, mObuStatusInfo.connectIP)
|
||||
} catch (e: Exception) {
|
||||
e.printStackTrace()
|
||||
}
|
||||
MogoObuManager.getInstance().connect(context, mObuStatusInfo.connectIP)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -96,6 +97,9 @@ class MogoPrivateObuManager private constructor() {
|
||||
mObuStatusInfo.obuStatus = true
|
||||
CallerObuListenerManager.invokeListener(mObuStatusInfo)
|
||||
mContext?.let { SharedPrefsMgr.getInstance(it).putBoolean("OBU", true) }
|
||||
|
||||
//断开mogo obu
|
||||
com.mogo.support.obu.MogoObuManager.getInstance().disconnect()
|
||||
}
|
||||
|
||||
// OBU连接失败
|
||||
@@ -207,7 +211,6 @@ class MogoPrivateObuManager private constructor() {
|
||||
e.printStackTrace()
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// (3) 远车信息:CVX_RV_INFO_IND
|
||||
|
||||
@@ -0,0 +1,788 @@
|
||||
package com.mogo.eagle.core.function.obu.mogo
|
||||
|
||||
import android.content.Context
|
||||
import android.util.Log
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig
|
||||
import com.mogo.eagle.core.data.enums.WarningDirectionEnum
|
||||
import com.mogo.eagle.core.function.api.hmi.warning.IMoGoWarningStatusListener
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager
|
||||
import com.mogo.eagle.core.function.call.map.CallerVisualAngleManager
|
||||
import com.mogo.eagle.core.function.call.map.CallerVisualAngleManager.Scene.Default
|
||||
import com.mogo.eagle.core.function.call.map.CallerVisualAngleManager.Scene.TooClose
|
||||
import com.mogo.eagle.core.function.call.obu.CallerObuListenerManager
|
||||
import com.mogo.eagle.core.function.obu.mogo.utils.TrafficDataConvertUtilsNew
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_OBU
|
||||
import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr
|
||||
import com.mogo.module.common.drawer.TrafficMarkerDrawer
|
||||
import com.mogo.module.common.enums.EventTypeEnumNew
|
||||
import com.mogo.module.common.enums.V2iEventTypeEnum
|
||||
import com.mogo.support.obu.MogoObuManager
|
||||
import com.mogo.support.obu.OnMogoObuListener
|
||||
import com.mogo.support.obu.constants.MogoObuComType
|
||||
import com.mogo.support.obu.constants.MogoObuConstants
|
||||
import com.mogo.support.obu.constants.MogoObuTopicId
|
||||
import com.mogo.support.obu.model.*
|
||||
import com.mogo.support.obu.model.advance.SpatLight
|
||||
import com.mogo.support.obu.option.MogoObuCom
|
||||
import com.mogo.support.obu.option.MogoObuOptions
|
||||
import org.json.JSONObject
|
||||
|
||||
/**
|
||||
*
|
||||
* @author lixiaopeng
|
||||
* @since 2021/8/23
|
||||
* @description 自研OBU 管理
|
||||
*/
|
||||
class MogoPrivateObuNewManager private constructor() {
|
||||
companion object {
|
||||
val INSTANCE: MogoPrivateObuNewManager by lazy(mode = LazyThreadSafetyMode.SYNCHRONIZED) {
|
||||
MogoPrivateObuNewManager()
|
||||
}
|
||||
}
|
||||
|
||||
private var mContext: Context? = null
|
||||
private val TAG = "ObuNewManager"
|
||||
private var mObuStatusInfo = CallerObuListenerManager.getObuStatusInfo()
|
||||
|
||||
|
||||
fun connectObu(context: Context, obuIpAddress: String, padIpAddress: String) {
|
||||
MogoObuManager.getInstance().registerMogoObuListener(mogoObuListener)
|
||||
val com = MogoObuCom.newBuilder()
|
||||
.setLocalIp(padIpAddress)
|
||||
.setComType(MogoObuComType.UDP)
|
||||
.setLocalPort(8888)
|
||||
.setServerIp(obuIpAddress)
|
||||
.setServerPort(32900)
|
||||
.build()
|
||||
|
||||
val options: MogoObuOptions = MogoObuOptions.newBuilder()
|
||||
.setCom(com)
|
||||
.registerTopic(MogoObuTopicId.HV_BASIC)
|
||||
.registerTopic(MogoObuTopicId.RV_WARNING)
|
||||
.registerTopic(MogoObuTopicId.SPAT_WARNING)
|
||||
.registerTopic(MogoObuTopicId.RSI_WARNING)
|
||||
.registerTopic(MogoObuTopicId.RSM_WARNING)
|
||||
.registerTopic(MogoObuTopicId.MAP_MATCH)
|
||||
.build()
|
||||
|
||||
//每次连接的时候如果连接连接了,先断开
|
||||
if (MogoObuManager.getInstance().connectStatus == 1) {
|
||||
try {
|
||||
MogoObuManager.getInstance().disconnect()
|
||||
} catch (e: Exception) {
|
||||
e.printStackTrace()
|
||||
}
|
||||
}
|
||||
|
||||
MogoObuManager.getInstance().connect(options)
|
||||
}
|
||||
|
||||
fun getMogoObuListener(): OnMogoObuListener {
|
||||
return mogoObuListener
|
||||
}
|
||||
|
||||
private val mogoObuListener: OnMogoObuListener = object : OnMogoObuListener() {
|
||||
/**
|
||||
* 连接状态的改变
|
||||
*/
|
||||
override fun onConnectStatus(connectStatus: Int) {
|
||||
if (connectStatus == 0) { //断开连接
|
||||
CallerLogger.d("$M_OBU${MogoObuConst.TAG_MOGO_OBU}", "onConnectFail ------> ")
|
||||
mObuStatusInfo.obuStatus = false
|
||||
mObuStatusInfo.obuHvStatus = false
|
||||
mObuStatusInfo.obuRvStatus = false
|
||||
CallerObuListenerManager.invokeListener(mObuStatusInfo)
|
||||
mContext?.let { SharedPrefsMgr.getInstance(it).putBoolean("OBU", false) }
|
||||
mContext?.let { SharedPrefsMgr.getInstance(it).putBoolean("OBU_HV", false) }
|
||||
mContext?.let { SharedPrefsMgr.getInstance(it).putBoolean("OBU_RV", false) }
|
||||
} else if (connectStatus == 1) { //连接成功
|
||||
CallerLogger.d("$M_OBU${MogoObuConst.TAG_MOGO_OBU}", "onConnected ------> ")
|
||||
mObuStatusInfo.obuStatus = true
|
||||
CallerObuListenerManager.invokeListener(mObuStatusInfo)
|
||||
mContext?.let { SharedPrefsMgr.getInstance(it).putBoolean("OBU", true) }
|
||||
|
||||
//断开老obu
|
||||
try {
|
||||
com.zhidao.support.obu.MogoObuManager.getInstance().disConnect()
|
||||
} catch (e: Exception) {
|
||||
e.printStackTrace()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* HV车辆基础信息 CvxHvCarIndInfo CvxHvInfoIndInfo
|
||||
*/
|
||||
override fun onMogoObuHvBasics(p0: MogoObuHvBasicsData?) {
|
||||
Log.d(
|
||||
TAG,
|
||||
"onMogoObuHvBasics ------ p0 = ${p0.toString()}" + "-----FunctionBuildConfig.gpsProvider = " + FunctionBuildConfig.gpsProvider
|
||||
)
|
||||
if (p0 != null && p0.vehBasicsMsg != null) {
|
||||
Log.d(
|
||||
TAG,
|
||||
"onMogoObuHvBasics lon = ${p0.vehBasicsMsg.longitude} --- lat = ${p0.vehBasicsMsg.latitude} ---speed = ${p0.vehBasicsMsg.speed} ---heading = ${p0.vehBasicsMsg.heading} --acceleration = ${p0.vehBasicsMsg.accFourAxes.accLat} --yawRate = ${p0.vehBasicsMsg.accFourAxes.accYaw}"
|
||||
)
|
||||
val data = JSONObject()
|
||||
try {
|
||||
data.putOpt("lon", p0.vehBasicsMsg.longitude)
|
||||
data.putOpt("lat", p0.vehBasicsMsg.latitude)
|
||||
data.putOpt("speed", p0.vehBasicsMsg.speed)
|
||||
data.putOpt("heading", p0.vehBasicsMsg.heading)
|
||||
data.putOpt("acceleration", p0.vehBasicsMsg.accFourAxes.accLat)
|
||||
data.putOpt("yawRate", p0.vehBasicsMsg.accFourAxes.accYaw)
|
||||
|
||||
try {
|
||||
data.putOpt("systemTime", System.currentTimeMillis())
|
||||
} catch (e: Exception) {
|
||||
e.printStackTrace()
|
||||
}
|
||||
try {
|
||||
data.putOpt("satelliteTime", System.currentTimeMillis())
|
||||
} catch (e: Exception) {
|
||||
e.printStackTrace()
|
||||
}
|
||||
|
||||
// 使用与渠道配置一样的gps提供者提供的数据,app/productFlavors/fPadLenovo.gradle GPS_PROVIDER 0-Android系统,1-工控机,2-OBU
|
||||
if (2 == FunctionBuildConfig.gpsProvider) {
|
||||
// 同步给MAP地图
|
||||
CallerMapUIServiceManager.getMapUIController()?.syncLocation2Map(data)
|
||||
// 同步更新经纬度和系统时间至 AutoPilotStatusListener
|
||||
CallerAutoPilotStatusListenerManager.updateAutoPilotLatLon(
|
||||
System.currentTimeMillis() / 1000.0,
|
||||
p0.vehBasicsMsg.longitude,
|
||||
p0.vehBasicsMsg.latitude
|
||||
)
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
e.printStackTrace()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* v2v预警信息 CvxRvInfoIndInfo CvxV2vThreatIndInfo 他车
|
||||
*/
|
||||
override fun onMogoObuRvWarning(data: MogoObuRvWarningData) {
|
||||
super.onMogoObuRvWarning(data)
|
||||
|
||||
// 更新数据,远车数据,之前要匹配uuid
|
||||
TrafficDataConvertUtilsNew.cvxRvInfoIndInfo2TrafficData(data)?.let {
|
||||
TrafficMarkerDrawer.updateITrafficLocationInfo(it)
|
||||
}
|
||||
|
||||
Log.d(TAG, data.toString())
|
||||
data.let {
|
||||
//预警信息,预警类型 threat_level 2、3
|
||||
var status = data.status
|
||||
data.vehBasicsMsg?.let {
|
||||
//预警方位
|
||||
val direction = getMessageDirection(data.vehBasicsMsg.targetPosition)
|
||||
//处理预警类型
|
||||
var appId = "0"
|
||||
var level = -1
|
||||
|
||||
data.warningMsg?.let {
|
||||
if (data.warningMsg.warningData != null && data.warningMsg.warningData.size > 0) {
|
||||
level = data.warningMsg.warningData[0].warningLevel
|
||||
appId = data.warningMsg.warningData[0].warningType.toString()
|
||||
}
|
||||
}
|
||||
|
||||
CallerLogger.d(
|
||||
"$M_OBU${MogoObuConst.TAG_MOGO_OBU}",
|
||||
"onMogoObuRvWarning target_classification = ${
|
||||
getMessageDirection(data.vehBasicsMsg.targetPosition)
|
||||
} --- direction = $direction --- appId = $appId ---level = $level -- status = $status"
|
||||
)
|
||||
|
||||
Log.e(
|
||||
TAG,
|
||||
"onMogoObuRvWarning target_classification = ${
|
||||
getMessageDirection(data.vehBasicsMsg.targetPosition)
|
||||
} --- direction = $direction --- appId = $appId ---level = $level -- status = $status"
|
||||
)
|
||||
|
||||
//拼凑数据
|
||||
if (appId != null) {
|
||||
handleSdkObu(appId, direction, status, level, data)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 红绿灯预警信息 CvxIvpThreatIndInfo
|
||||
*/
|
||||
override fun onMogoObuSpatWarning(data: MogoObuSpatWarningData) {
|
||||
super.onMogoObuSpatWarning(data)
|
||||
if (data?.lights != null && data.lights.isNotEmpty()
|
||||
) {
|
||||
handlerTrafficLight(
|
||||
data.warningType,
|
||||
data.status,
|
||||
data.lights
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* RSI预警信息 CvxRtiThreatIndInfo(交通标志预警(前方限速、前方学校等等),交通事件预警(前方拥堵、前方积水等等))
|
||||
*/
|
||||
override fun onMogoObuRsiWarning(data: MogoObuRsiWarningData) {
|
||||
super.onMogoObuRsiWarning(data)
|
||||
CallerLogger.d(
|
||||
"$M_OBU${MogoObuConst.TAG_MOGO_OBU}",
|
||||
"onMogoObuRsiWarning ------> $data"
|
||||
)
|
||||
if (data != null && data.warning_Msg != null && data.warning_Msg.size > 0) {
|
||||
var alertContent = ""
|
||||
var ttsContent = ""
|
||||
var appId = data.warning_Msg[0].sceneType.toString()
|
||||
val status = data.status
|
||||
val level = data.warning_Msg[0].warningLevel
|
||||
val direction = getMessageDirection(data.warning_Msg[0].targetPosition)
|
||||
CallerLogger.d(
|
||||
"$M_OBU${MogoObuConst.TAG_MOGO_OBU}",
|
||||
"onCvxRtiThreatIndInfo appId = $appId --status = $status --level = $level -- eventSerialNum = ${data.warning_Msg[0].eventSerialNum} -- direction = $direction -- targetPosition = ${data.warning_Msg[0].targetPosition}"
|
||||
)
|
||||
|
||||
when (appId) {
|
||||
// 道路危险情况预警
|
||||
V2iEventTypeEnum.TYPE_USECASE_ID_HLW.poiType
|
||||
-> {
|
||||
when (data.warning_Msg[0].eventSerialNum) {
|
||||
MogoObuConstants.RTE.RTI_TYPE_RETRIGRADE -> { //车辆逆行
|
||||
appId =
|
||||
V2iEventTypeEnum.TYPE_USECASE_ID_ROAD_VEHICLE_RETROGRADE.poiType
|
||||
}
|
||||
MogoObuConstants.RTE.RTI_TYPE_SPEEDING -> { //超速行驶
|
||||
appId = V2iEventTypeEnum.TYPE_USECASE_ID_SLW.poiType
|
||||
}
|
||||
MogoObuConstants.RTE.RTI_TYPE_BREAKDOWN -> {//车辆故障
|
||||
appId = V2iEventTypeEnum.TYPE_USECASE_ID_BREAKDOWN_WARNING.poiType
|
||||
}
|
||||
MogoObuConstants.RTE.RTI_TYPE_CONSTRUCTION_RTE -> { //施工占道
|
||||
appId = V2iEventTypeEnum.FOURS_ROAD_WORK.poiType
|
||||
}
|
||||
MogoObuConstants.RTE.RTI_TYPE_PARKING_VIOLATION -> { //异常停车
|
||||
appId = V2iEventTypeEnum.TYPE_USECASE_ID_ROAD_PARKING.poiType
|
||||
}
|
||||
MogoObuConstants.RTE.RTI_TYPE_ROAD_WATER -> { //道路积水
|
||||
appId = V2iEventTypeEnum.FOURS_PONDING.poiType
|
||||
}
|
||||
}
|
||||
alertContent = V2iEventTypeEnum.getWarningContent(appId)
|
||||
ttsContent = V2iEventTypeEnum.getWarningTts(appId)
|
||||
}
|
||||
|
||||
V2iEventTypeEnum.TYPE_USECASE_ID_IVS.poiType -> { //车内标牌
|
||||
when (data.warning_Msg[0].eventSerialNum) {
|
||||
MogoObuConstants.RTS.RTI_TYPE_SCHOOL -> { //学校
|
||||
appId =
|
||||
V2iEventTypeEnum.TYPE_USECASE_ID_ROAD_PEDESTRIAN_SCHOOL.poiType
|
||||
}
|
||||
|
||||
}
|
||||
alertContent = V2iEventTypeEnum.getWarningContent(appId)
|
||||
ttsContent = V2iEventTypeEnum.getWarningTts(appId)
|
||||
}
|
||||
|
||||
// 前方拥堵提醒 TODO
|
||||
V2iEventTypeEnum.TYPE_USECASE_ID_TJW.poiType -> {
|
||||
ttsContent = V2iEventTypeEnum.getWarningTts(appId)
|
||||
alertContent = if (data.warning_Msg[0].distance.toInt() != 0) {
|
||||
String.format(
|
||||
V2iEventTypeEnum.getWarningContent(appId),
|
||||
data.warning_Msg[0].distance.toInt()
|
||||
)
|
||||
} else {
|
||||
"前方拥堵,减速慢行"
|
||||
}
|
||||
}
|
||||
|
||||
//限速预警 TODO 参考之前的
|
||||
|
||||
}
|
||||
|
||||
CallerLogger.d(
|
||||
"$M_OBU${MogoObuConst.TAG_MOGO_OBU}",
|
||||
"ttsContent = $ttsContent --alertContent = $alertContent --appId = $appId ---direction = ${direction.direction} "
|
||||
)
|
||||
|
||||
when (status) {
|
||||
// 添加
|
||||
MogoObuConstants.STATUS.ADD,
|
||||
MogoObuConstants.STATUS.UPDATE// 更新
|
||||
-> {
|
||||
//显示警告红边
|
||||
// CallerHmiManager.showWarning(direction)
|
||||
//显示弹框,语音提示
|
||||
CallerHmiManager.showWarningV2X(
|
||||
appId,
|
||||
alertContent,
|
||||
ttsContent,// 只有第一次才tts,防止更新的时候不断的提醒
|
||||
(appId + direction.direction),//使用当前事件类型+方向记录tag,当发生变化的时候关闭当前弹出新的
|
||||
object : IMoGoWarningStatusListener {
|
||||
override fun onDismiss() {
|
||||
// 关闭警告红边
|
||||
CallerHmiManager.showWarning(WarningDirectionEnum.ALERT_WARNING_NON)
|
||||
}
|
||||
},
|
||||
true,
|
||||
3000L
|
||||
)
|
||||
// 更新数据
|
||||
TrafficDataConvertUtilsNew.cvxRtiThreatIndInfo2TrafficData(data)?.let {
|
||||
TrafficMarkerDrawer.updateITrafficThreatLevelInfo(it)
|
||||
}
|
||||
}
|
||||
// 删除
|
||||
MogoObuConstants.STATUS.DELETE -> {
|
||||
// 关闭警告红边
|
||||
CallerHmiManager.showWarning(WarningDirectionEnum.ALERT_WARNING_NON)
|
||||
// 移除顶部弹窗
|
||||
CallerHmiManager.disableWarningV2X((appId + direction.direction))
|
||||
// 更新数据
|
||||
TrafficDataConvertUtilsNew.cvxRtiThreatIndInfo2TrafficData(data)?.let {
|
||||
// 事件结束,还原车辆颜色
|
||||
it.threatLevel = 0x01
|
||||
TrafficMarkerDrawer.updateITrafficInfo(it)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* RSM预警信息 CvxPtcThreatIndInfo CvxPtcInfoIndInfo(主车与弱势交通参与者之间的预警(如:弱势交通参与者碰撞预警))
|
||||
*/
|
||||
override fun onMogoObuRsmWarning(data: MogoObuRsmWarningData?) {
|
||||
super.onMogoObuRsmWarning(data)
|
||||
CallerLogger.d(
|
||||
"$M_OBU${MogoObuConst.TAG_MOGO_OBU}",
|
||||
"onMogoObuRsmWarning ------> $data"
|
||||
)
|
||||
Log.d(TAG, "data = ${data.toString()}")
|
||||
// 交通参与者类型 0x0:未知 UNKNOWN | 1机动车 2:非机动车 NON_MOTOR | 3:行人 PEDESTRIAN 4:obu
|
||||
if (data != null && data.participant != null && (data.participant.ptcType == 1 || data.participant.ptcType == 3)) {
|
||||
CallerLogger.d(
|
||||
"$M_OBU${MogoObuConst.TAG_MOGO_OBU}",
|
||||
"onMogoObuRsmWarning ---status---> ${data.status}"
|
||||
)
|
||||
var v2xType = ""
|
||||
if (data.participant.ptcType == 1) { //摩托车
|
||||
v2xType = EventTypeEnumNew.TYPE_USECASE_ID_VRUCW_MOTORBIKE.poiType
|
||||
} else if (data.participant.ptcType == 2) { //行人
|
||||
v2xType = EventTypeEnumNew.TYPE_USECASE_ID_VRUCW_PERSON.poiType
|
||||
}
|
||||
val ttsContent = EventTypeEnumNew.getWarningTts(v2xType)
|
||||
val alertContent = EventTypeEnumNew.getWarningContent(v2xType)
|
||||
var level = -1
|
||||
val direction = getMessageDirection(data.participant.targetPosition)
|
||||
if (data.m_warning_msg != null && data.m_warning_msg.warningData != null && data.m_warning_msg.warningData.size > 0) {
|
||||
level = data.m_warning_msg.warningData[0].warningLevel
|
||||
}
|
||||
|
||||
when (data.status) {
|
||||
// 添加
|
||||
MogoObuConstants.STATUS.ADD,
|
||||
MogoObuConstants.STATUS.UPDATE// 更新
|
||||
-> {
|
||||
// if (level == 2 || level == 3) { //不考虑level
|
||||
//显示警告红边
|
||||
CallerHmiManager.showWarning(direction)
|
||||
CallerHmiManager.showWarningV2X(
|
||||
v2xType,
|
||||
alertContent,
|
||||
ttsContent,// 只有第一次才tts,防止更新的时候不断的提醒
|
||||
(v2xType + direction.direction),//使用当前事件类型+方向记录tag,当发生变化的时候关闭当前弹出新的
|
||||
object : IMoGoWarningStatusListener {
|
||||
override fun onDismiss() {
|
||||
// 关闭警告红边
|
||||
CallerHmiManager.showWarning(WarningDirectionEnum.ALERT_WARNING_NON)
|
||||
}
|
||||
},
|
||||
true,
|
||||
3000L
|
||||
)
|
||||
// }
|
||||
// 更新数据
|
||||
TrafficDataConvertUtilsNew.cvxPtcThreatIndInfo2TrafficData(data)?.let {
|
||||
TrafficMarkerDrawer.updateITrafficInfo(it)
|
||||
}
|
||||
}
|
||||
|
||||
// 删除
|
||||
MogoObuConstants.STATUS.DELETE -> {
|
||||
// 关闭警告红边
|
||||
CallerHmiManager.showWarning(WarningDirectionEnum.ALERT_WARNING_NON)
|
||||
// 更新数据
|
||||
TrafficDataConvertUtilsNew.cvxPtcThreatIndInfo2TrafficData(data)?.let {
|
||||
// 事件结束,还原交通参与者颜色
|
||||
it.threatLevel = 0x01
|
||||
TrafficMarkerDrawer.updateITrafficThreatLevelInfo(it)
|
||||
}
|
||||
//TODO
|
||||
// CallerHmiManager.disableWarningV2X(ObuConstants.USE_CASE_ID.VRUCW.toString())
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 地图匹配 是OBU算法输出地图匹配结果,主车匹配道路哪条路或者哪条车道
|
||||
*/
|
||||
override fun onMogoObuMapMath(data: MogoObuMapMathData?) {
|
||||
super.onMogoObuMapMath(data)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取消息的方位 车辆相关
|
||||
*/
|
||||
private fun getMessageDirection(targetClassification: Int): WarningDirectionEnum {
|
||||
CallerLogger.d("$M_OBU${MogoObuConst.TAG_MOGO_OBU}", "预警红边:预警方向->$targetClassification")
|
||||
return when (targetClassification) {
|
||||
MogoObuConstants.VEH_TARGET_POSITION.AHEAD_IN_LANE,
|
||||
MogoObuConstants.VEH_TARGET_POSITION.ONCOMING_IN_LANE -> WarningDirectionEnum.ALERT_WARNING_TOP //正前方
|
||||
|
||||
MogoObuConstants.VEH_TARGET_POSITION.BEHEAD_IN_LANE -> WarningDirectionEnum.ALERT_WARNING_BOTTOM //正后方
|
||||
|
||||
MogoObuConstants.VEH_TARGET_POSITION.INTERSECTION_RIGHT -> WarningDirectionEnum.ALERT_WARNING_RIGHT //正右方
|
||||
|
||||
MogoObuConstants.VEH_TARGET_POSITION.INTERSECTION_LEFT -> WarningDirectionEnum.ALERT_WARNING_LEFT //正左方
|
||||
|
||||
MogoObuConstants.VEH_TARGET_POSITION.AHEAD_LEFT, MogoObuConstants.VEH_TARGET_POSITION.AHEAD_FAR_LEFT,
|
||||
MogoObuConstants.VEH_TARGET_POSITION.ONCOMING_LEFT, MogoObuConstants.VEH_TARGET_POSITION.ONCOMING_FAR_LEFT
|
||||
-> WarningDirectionEnum.ALERT_WARNING_TOP_LEFT //左前方
|
||||
|
||||
MogoObuConstants.VEH_TARGET_POSITION.AHEAD_RIGHT, MogoObuConstants.VEH_TARGET_POSITION.AHEAD_FAR_RIGHT,
|
||||
MogoObuConstants.VEH_TARGET_POSITION.ONCOMING_RIGHT, MogoObuConstants.VEH_TARGET_POSITION.ONCOMING_FAT_RIGHT
|
||||
-> WarningDirectionEnum.ALERT_WARNING_TOP_RIGHT //右前方
|
||||
|
||||
MogoObuConstants.VEH_TARGET_POSITION.BEHEAD_LEFT, MogoObuConstants.VEH_TARGET_POSITION.BEHEAD_FAR_LEFT,
|
||||
-> WarningDirectionEnum.ALERT_WARNING_BOTTOM_LEFT //左后方
|
||||
|
||||
MogoObuConstants.VEH_TARGET_POSITION.BEHEAD_RIGHT, MogoObuConstants.VEH_TARGET_POSITION.BEHEAD_FAR_RIGHT,
|
||||
-> WarningDirectionEnum.ALERT_WARNING_BOTTOM_RIGHT //右后方
|
||||
|
||||
MogoObuConstants.VEH_TARGET_POSITION.UNCLASSIFIED -> WarningDirectionEnum.ALERT_WARNING_NON //未知
|
||||
else -> WarningDirectionEnum.ALERT_WARNING_ALL
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 构造对应展示数据和场景 根据obu的场景,add change delete确定是否展示
|
||||
*
|
||||
* @param appId 使用WarningTypeEnum获取icon、提示内容、tts内容
|
||||
*
|
||||
* @see com.mogo.module.common.enums.EventTypeEnum
|
||||
*/
|
||||
private fun handleSdkObu(
|
||||
appId: String,
|
||||
direction: WarningDirectionEnum,
|
||||
status: Int,
|
||||
level: Int,
|
||||
info: MogoObuRvWarningData
|
||||
) {
|
||||
// 这里排除需要特殊定制的语音及文案外,其余的都可以使用 EventTypeEnumNew 提供的
|
||||
CallerLogger.d(
|
||||
"$M_OBU${MogoObuConst.TAG_MOGO_OBU}",
|
||||
"handleSdkObu appId = $appId --- handleDirection = $direction ---level = $level ---status = $status"
|
||||
)
|
||||
Log.d(
|
||||
TAG,
|
||||
"handleSdkObu appId = $appId --- handleDirection = $direction ---level = $level ---status = $status"
|
||||
)
|
||||
var alertContent: String
|
||||
var ttsContent: String
|
||||
var changeVisualAngle = false
|
||||
when (appId) {
|
||||
// 变道预警,注意左后车辆/注意右后车辆
|
||||
EventTypeEnumNew.TYPE_USECASE_ID_LCW.poiType -> {
|
||||
alertContent = EventTypeEnumNew.getWarningContent(appId)
|
||||
ttsContent = EventTypeEnumNew.getWarningTts(appId)
|
||||
if (
|
||||
direction == WarningDirectionEnum.ALERT_WARNING_LEFT ||
|
||||
direction == WarningDirectionEnum.ALERT_WARNING_TOP_LEFT ||
|
||||
direction == WarningDirectionEnum.ALERT_WARNING_BOTTOM_LEFT
|
||||
) {
|
||||
ttsContent = String.format(ttsContent, "左")
|
||||
alertContent = String.format(alertContent, "左")
|
||||
} else if (
|
||||
direction == WarningDirectionEnum.ALERT_WARNING_RIGHT ||
|
||||
direction == WarningDirectionEnum.ALERT_WARNING_TOP_RIGHT ||
|
||||
direction == WarningDirectionEnum.ALERT_WARNING_BOTTOM_RIGHT
|
||||
) {
|
||||
ttsContent = String.format(ttsContent, "右")
|
||||
alertContent = String.format(alertContent, "右")
|
||||
}
|
||||
}
|
||||
|
||||
//车辆失控预警
|
||||
EventTypeEnumNew.TYPE_USECASE_ID_CLW.poiType -> {
|
||||
alertContent = EventTypeEnumNew.getWarningContent(appId)
|
||||
ttsContent = EventTypeEnumNew.getWarningTts(appId)
|
||||
alertContent = String.format(alertContent, direction.desc)
|
||||
ttsContent = String.format(ttsContent, direction.desc)
|
||||
}
|
||||
|
||||
//左转辅助
|
||||
// EventTypeEnum.TYPE_USECASE_ID_LTA.poiType -> {
|
||||
// alertContent = EventTypeEnum.getWarningContent(appId)
|
||||
// ttsContent = EventTypeEnum.getWarningTts(appId)
|
||||
// }
|
||||
|
||||
//异常车辆提醒
|
||||
EventTypeEnumNew.TYPE_USECASE_ID_AVW.poiType -> {
|
||||
alertContent = EventTypeEnumNew.getWarningContent(appId)
|
||||
ttsContent = EventTypeEnumNew.getWarningTts(appId)
|
||||
alertContent = String.format(alertContent, direction.desc)
|
||||
ttsContent = String.format(ttsContent, direction.desc)
|
||||
}
|
||||
|
||||
//盲区预警
|
||||
EventTypeEnumNew.TYPE_USECASE_ID_BSW.poiType -> {
|
||||
ttsContent = EventTypeEnumNew.getWarningTts(appId)
|
||||
alertContent = EventTypeEnumNew.getWarningContent(appId)
|
||||
if (
|
||||
direction == WarningDirectionEnum.ALERT_WARNING_LEFT ||
|
||||
direction == WarningDirectionEnum.ALERT_WARNING_TOP_LEFT ||
|
||||
direction == WarningDirectionEnum.ALERT_WARNING_BOTTOM_LEFT
|
||||
) { //左后
|
||||
changeVisualAngle = true
|
||||
ttsContent = String.format(ttsContent, "左")
|
||||
alertContent = String.format(alertContent, "左")
|
||||
} else if (
|
||||
direction == WarningDirectionEnum.ALERT_WARNING_RIGHT ||
|
||||
direction == WarningDirectionEnum.ALERT_WARNING_TOP_RIGHT ||
|
||||
direction == WarningDirectionEnum.ALERT_WARNING_BOTTOM_RIGHT
|
||||
) { //右后
|
||||
changeVisualAngle = true
|
||||
ttsContent = String.format(ttsContent, "右")
|
||||
alertContent = String.format(alertContent, "右")
|
||||
}
|
||||
}
|
||||
|
||||
// 这里处理固定的提示信息,包括了<紧急车辆提醒>
|
||||
else -> {
|
||||
ttsContent = EventTypeEnumNew.getWarningTts(appId)
|
||||
alertContent = EventTypeEnumNew.getWarningContent(appId)
|
||||
}
|
||||
}
|
||||
|
||||
when (status) {
|
||||
// 添加,更新 add的时候,可能级别是2,
|
||||
MogoObuConstants.STATUS.ADD,
|
||||
MogoObuConstants.STATUS.UPDATE -> {
|
||||
CallerLogger.d(
|
||||
"$M_OBU${MogoObuConst.TAG_MOGO_OBU}",
|
||||
"appId2 = $appId --- level = $level ---ttsContent = $ttsContent --- alertContent = $alertContent --- direction = $direction"
|
||||
)
|
||||
Log.d(
|
||||
TAG,
|
||||
"appId2 = $appId --- level = $level ---ttsContent = $ttsContent --- alertContent = $alertContent --- direction = $direction"
|
||||
)
|
||||
if (level == 2 || level == 3) {
|
||||
//显示弹框,语音提示
|
||||
CallerHmiManager.showWarningV2X(
|
||||
appId,
|
||||
alertContent,
|
||||
ttsContent,// 只有第一次才tts,防止更新的时候不断的提醒
|
||||
(appId + direction.direction),//使用当前事件类型+方向记录tag,当发生变化的时候关闭当前弹出新的
|
||||
object : IMoGoWarningStatusListener {
|
||||
override fun onShow() {
|
||||
super.onShow()
|
||||
if (changeVisualAngle) {
|
||||
CallerVisualAngleManager.changeVisualAngle(TooClose)
|
||||
}
|
||||
}
|
||||
|
||||
override fun onDismiss() {
|
||||
// 关闭警告红边
|
||||
CallerHmiManager.showWarning(WarningDirectionEnum.ALERT_WARNING_NON)
|
||||
if (changeVisualAngle) {
|
||||
CallerVisualAngleManager.changeVisualAngle(Default())
|
||||
}
|
||||
}
|
||||
},
|
||||
true,
|
||||
3000L
|
||||
)
|
||||
//显示警告红边
|
||||
CallerHmiManager.showWarning(direction)
|
||||
}
|
||||
//更新周边车辆进行预警颜色变换,车辆实时移动和变色 ,UUID不需要匹配了
|
||||
TrafficDataConvertUtilsNew.cvxV2vThreatIndInfo2TrafficData(info)?.let {
|
||||
TrafficMarkerDrawer.updateITrafficThreatLevelInfo(it)
|
||||
}
|
||||
}
|
||||
// 删除
|
||||
MogoObuConstants.STATUS.DELETE -> {
|
||||
// 关闭警告红边
|
||||
CallerHmiManager.showWarning(WarningDirectionEnum.ALERT_WARNING_NON)
|
||||
// 移除顶部弹窗
|
||||
CallerHmiManager.disableWarningV2X((appId + direction.direction))
|
||||
//更新周边车辆进行预警颜色变换,车辆实时移动和变色
|
||||
TrafficDataConvertUtilsNew.cvxV2vThreatIndInfo2TrafficData(info)?.let {
|
||||
it.threatLevel = 0x01
|
||||
TrafficMarkerDrawer.updateITrafficThreatLevelInfo(it)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理红绿灯
|
||||
*/
|
||||
private fun handlerTrafficLight(appId: Int, status: Int, lights: List<SpatLight>) {
|
||||
CallerLogger.d(
|
||||
"$M_OBU${MogoObuConst.TAG_MOGO_OBU}",
|
||||
"handlerTrafficLight --- status = $status ---lights.size = ${lights.size} ---lights = $lights "
|
||||
)
|
||||
Log.d(
|
||||
TAG,
|
||||
"handlerTrafficLight --- status = $status ---lights.size = ${lights.size} ---lights = $lights "
|
||||
)
|
||||
MogoObuConstants.CONNECT_STATUS.CONNECTED
|
||||
when (status) {
|
||||
// 添加
|
||||
MogoObuConstants.STATUS.ADD,
|
||||
MogoObuConstants.STATUS.UPDATE
|
||||
-> {
|
||||
changeTrafficLightStatus(appId, lights)
|
||||
}
|
||||
// 删除
|
||||
MogoObuConstants.STATUS.DELETE -> {
|
||||
// 移除顶部弹窗
|
||||
CallerHmiManager.disableWarningTrafficLight()
|
||||
CallerHmiManager.disableWarningV2X(appId.toString())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private var isRedLight = false
|
||||
private var isGreenLight = false
|
||||
|
||||
/**
|
||||
* 修改红绿灯
|
||||
*/
|
||||
@Synchronized
|
||||
private fun changeTrafficLightStatus(
|
||||
appId: Int,
|
||||
lights: List<SpatLight>
|
||||
) {
|
||||
var ttsContent = ""
|
||||
var alertContent = ""
|
||||
//这里需要根据真实数据确定 index 取值方式
|
||||
val currentLight = lights[0]
|
||||
CallerLogger.d(
|
||||
"$M_OBU${MogoObuConst.TAG_MOGO_OBU}",
|
||||
"currentLight = $currentLight ---currentLight.phase = ${currentLight.phaseId} ---appId = $appId"
|
||||
)
|
||||
Log.d(
|
||||
TAG,
|
||||
"currentLight = $currentLight ---currentLight.phase = ${currentLight.phaseId} ---appId = $appId"
|
||||
)
|
||||
// 闯红灯预警
|
||||
when (appId) {
|
||||
0x0 -> {//不可用 V2I_RLVW_VIOLATION_TYPE_UNAVAILABLE
|
||||
}
|
||||
0x1 -> {//无违规 V2I_RLVW_VIOLATION_TYPE_NO_VIOLATION
|
||||
CallerHmiManager.disableWarningV2X(appId.toString())
|
||||
}
|
||||
0x2 -> {//闯红灯 V2I_RLVW_VIOLATION_TYPE_RUNNING_RED_LIGHT
|
||||
ttsContent = EventTypeEnumNew.getWarningTts(appId.toString())
|
||||
alertContent = EventTypeEnumNew.getWarningContent(appId.toString())
|
||||
CallerHmiManager.showWarningV2X(
|
||||
appId.toString(), alertContent, ttsContent,// 只有第一次才tts,防止更新的时候不断的提醒
|
||||
appId.toString(), null, true, 3000L
|
||||
)
|
||||
}
|
||||
0x3 -> {//闯黄灯 V2I_RLVW_VIOLATION_TYPE_RUNNING_YELLOW_LIGHT
|
||||
}
|
||||
}
|
||||
|
||||
when (currentLight.light) {
|
||||
// 灯光不可用
|
||||
0x0 -> {
|
||||
CallerHmiManager.showWarningTrafficLight(0, 2)
|
||||
}
|
||||
// 红灯
|
||||
0x1 -> {
|
||||
if (!isRedLight) {
|
||||
CallerHmiManager.disableWarningV2X(appId.toString())
|
||||
isRedLight = true
|
||||
}
|
||||
isGreenLight = false
|
||||
CallerHmiManager.showWarningTrafficLight(1, 2)
|
||||
|
||||
val red = currentLight.countDown.toInt()
|
||||
CallerHmiManager.changeCountdownRed(red)
|
||||
CallerHmiManager.changeCountdownGreen(0)
|
||||
CallerHmiManager.changeCountdownYellow(0)
|
||||
}
|
||||
// 绿灯
|
||||
0x2 -> {
|
||||
if (!isGreenLight) {
|
||||
CallerHmiManager.disableWarningV2X(appId.toString())
|
||||
isGreenLight = true
|
||||
}
|
||||
isRedLight = false
|
||||
CallerHmiManager.showWarningTrafficLight(3, 2)
|
||||
val green = currentLight.countDown.toInt()
|
||||
CallerHmiManager.changeCountdownGreen(green)
|
||||
//防止数据出现问题的容错
|
||||
CallerHmiManager.changeCountdownRed(0)
|
||||
CallerHmiManager.changeCountdownYellow(0)
|
||||
// 拼接建议速度
|
||||
CallerLogger.d(
|
||||
"$M_OBU${MogoObuConst.TAG_MOGO_OBU}",
|
||||
"speed_min = ${currentLight.suggestMinSpeed} --speed_max = ${currentLight.suggestMaxSpeed}"
|
||||
)
|
||||
val adviceSpeed =
|
||||
"${currentLight.suggestMinSpeed} - ${currentLight.suggestMaxSpeed}"
|
||||
val adviceSpeedTts =
|
||||
"${currentLight.suggestMinSpeed}到${currentLight.suggestMaxSpeed}"
|
||||
ttsContent =
|
||||
String.format(
|
||||
EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_USECASE_ID_IVP_GREEN.poiType),
|
||||
adviceSpeedTts
|
||||
)
|
||||
alertContent =
|
||||
String.format(
|
||||
EventTypeEnumNew.getWarningContent(EventTypeEnumNew.TYPE_USECASE_ID_IVP_GREEN.poiType),
|
||||
adviceSpeed
|
||||
)
|
||||
|
||||
val maxSpeed = currentLight.suggestMaxSpeed
|
||||
if (maxSpeed > 0) {
|
||||
CallerHmiManager.showWarningV2X(
|
||||
EventTypeEnumNew.TYPE_USECASE_ID_IVP_GREEN.poiType,
|
||||
alertContent,
|
||||
ttsContent,// 只有第一次才tts,防止更新的时候不断的提醒
|
||||
appId.toString(),
|
||||
null,
|
||||
true,
|
||||
3000L
|
||||
)
|
||||
}
|
||||
}
|
||||
// 黄灯
|
||||
0x3 -> {
|
||||
CallerHmiManager.disableWarningV2X(appId.toString())
|
||||
CallerHmiManager.showWarningTrafficLight(2, 2)
|
||||
val yellow = currentLight.countDown.toInt()
|
||||
CallerHmiManager.changeCountdownYellow(yellow)
|
||||
CallerHmiManager.changeCountdownGreen(0)
|
||||
CallerHmiManager.changeCountdownRed(0)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -3,16 +3,16 @@ package com.mogo.eagle.core.function.obu.mogo.receiver
|
||||
import android.content.BroadcastReceiver
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import com.mogo.eagle.core.function.obu.mogo.MogoObuConst
|
||||
import com.mogo.eagle.core.function.obu.mogo.MogoPrivateObuManager
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_OBU
|
||||
import com.zhidao.support.obu.constants.ObuConstants
|
||||
import com.zhidao.support.obu.model.CvxIvpThreatIndInfo
|
||||
import com.zhidao.support.obu.model.CvxPtcThreatIndInfo
|
||||
import com.zhidao.support.obu.model.CvxRtiThreatIndInfo
|
||||
import com.zhidao.support.obu.model.CvxSlwThreatIndInfo
|
||||
import com.zhidao.support.obu.model.advance.*
|
||||
//import com.mogo.eagle.core.function.obu.mogo.MogoObuConst
|
||||
//import com.mogo.eagle.core.function.obu.mogo.MogoPrivateObuManager
|
||||
//import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
//import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_OBU
|
||||
//import com.zhidao.support.obu.constants.ObuConstants
|
||||
//import com.zhidao.support.obu.model.CvxIvpThreatIndInfo
|
||||
//import com.zhidao.support.obu.model.CvxPtcThreatIndInfo
|
||||
//import com.zhidao.support.obu.model.CvxRtiThreatIndInfo
|
||||
//import com.zhidao.support.obu.model.CvxSlwThreatIndInfo
|
||||
//import com.zhidao.support.obu.model.advance.*
|
||||
|
||||
/**
|
||||
* @author lixiaopeng
|
||||
@@ -31,90 +31,90 @@ class ObuRsuTestTriggerReceiver : BroadcastReceiver() {
|
||||
override fun onReceive(context: Context, intent: Intent) {
|
||||
mContext = context
|
||||
|
||||
val obuType = intent.getIntExtra(MogoObuConst.BROADCAST_OBU_TYPE_EXTRA_KEY, 0)
|
||||
val obuStatus = intent.getIntExtra(MogoObuConst.BROADCAST_OBU_STATES_EXTRA_KEY, 0)
|
||||
val obuLevel = intent.getIntExtra(MogoObuConst.BROADCAST_OBU_LEVEL_EXTRA_KEY, 3)
|
||||
val indicator = intent.getIntExtra(MogoObuConst.BROADCAST_LIGHT_LEVEL_EXTRA_KEY, 0)
|
||||
val pctType = intent.getIntExtra(MogoObuConst.BROADCAST_PTC_INFO_EXTRA_KEY, 0)
|
||||
val rtiType = intent.getIntExtra(MogoObuConst.BROADCAST_RTI_TYPE_EXTRA_KEY, 0)
|
||||
|
||||
CallerLogger.d(
|
||||
"$M_OBU$TAG", "obuStatus:$obuStatus phase:$indicator obuType:$obuType obuLevel:$obuLevel"
|
||||
)
|
||||
|
||||
when (obuType) {
|
||||
ObuConstants.USE_CASE_ID.IVP -> { //构建红绿灯数据
|
||||
val cvxIvpThreatIndInfo = CvxIvpThreatIndInfo(1, 1, 1L)
|
||||
|
||||
val ivpThreat = IvpThreat(1, obuType, null, 1000, obuLevel, 100)
|
||||
|
||||
cvxIvpThreatIndInfo.threat_info = ivpThreat
|
||||
|
||||
val lightList = listOf(
|
||||
Light(1, 0x0, 1000, 3000, 6000, 3000, 100, 1000),
|
||||
Light(1, 0x1, 1000, 3000, 6000, 3000, 100, 1000),
|
||||
Light(1, 0x2, 1000, 3000, 6000, 3000, 100, 1000),
|
||||
Light(1, 0x3, 1000, 3000, 6000, 3000, 100, 1000)
|
||||
)
|
||||
val ivpThreatExt = IvpThreatExt(1, 1000, 1000, 0, indicator, lightList)
|
||||
cvxIvpThreatIndInfo.ext_info = ivpThreatExt
|
||||
cvxIvpThreatIndInfo.status = obuStatus
|
||||
cvxIvpThreatIndInfo.link_id = "1"
|
||||
|
||||
MogoPrivateObuManager.INSTANCE.getMogoObuListener()
|
||||
.onCvxIvpThreatIndInfo(cvxIvpThreatIndInfo)
|
||||
}
|
||||
|
||||
ObuConstants.USE_CASE_ID.SLW -> { //限速预警
|
||||
val cvxSlwThreatIndInfo = CvxSlwThreatIndInfo(1, 1, 1L)
|
||||
val slwThreatExt = SlwThreatExt(1, 2, 6000, 2000)
|
||||
|
||||
cvxSlwThreatIndInfo.ext_info = slwThreatExt
|
||||
cvxSlwThreatIndInfo.status = obuStatus
|
||||
|
||||
MogoPrivateObuManager.INSTANCE.getMogoObuListener()
|
||||
.onCvxSlwThreatIndInfo(cvxSlwThreatIndInfo)
|
||||
}
|
||||
|
||||
//弱势交通参与者碰撞预警,行人/摩托车碰撞预警
|
||||
ObuConstants.USE_CASE_ID.VRUCW -> {
|
||||
val cvxPtcIndInfo = CvxPtcThreatIndInfo(1, 1, 1)
|
||||
val position = Position(1, 399739429, 1164115207, 20)
|
||||
cvxPtcIndInfo.ptc_pos = position
|
||||
cvxPtcIndInfo.ptc_id = "111"
|
||||
cvxPtcIndInfo.ptc_type = pctType
|
||||
cvxPtcIndInfo.status = obuStatus
|
||||
|
||||
val v2vThreat = V2vThreat(1, obuType, null, 1000, obuLevel, 100)
|
||||
cvxPtcIndInfo.threat_info = v2vThreat
|
||||
|
||||
MogoPrivateObuManager.INSTANCE.getMogoObuListener()
|
||||
.onCvxPtcThreatIndInfo(cvxPtcIndInfo)
|
||||
}
|
||||
|
||||
//道路危险情况, 车内标牌, 前方拥堵提醒
|
||||
ObuConstants.USE_CASE_ID.HLW, ObuConstants.USE_CASE_ID.IVS, ObuConstants.USE_CASE_ID.TJW -> {
|
||||
val cvxRtiThreatIndInfo = CvxRtiThreatIndInfo(1, 1, 1L)
|
||||
val dateTime = DateTime(1, 1, 1, 1, 1, 1, 1, 1)
|
||||
val rtiThread = RtiThreat(1, obuType, dateTime, 100000, obuLevel, 100)
|
||||
val extInfo = RtiThreatExt(1, rtiType, 0x02, 100000, 100000)
|
||||
val position = Position(1, 399739429, 1164115207, 20)
|
||||
|
||||
// 位置围栏
|
||||
val zonesInfo = listOf(
|
||||
ZoneInfo(1, 2000, 2000, listOf(position))
|
||||
)
|
||||
|
||||
cvxRtiThreatIndInfo.rti_id = "123123"
|
||||
cvxRtiThreatIndInfo.zones_info = zonesInfo
|
||||
cvxRtiThreatIndInfo.threat_info = rtiThread
|
||||
cvxRtiThreatIndInfo.ext_info = extInfo
|
||||
cvxRtiThreatIndInfo.status = obuStatus
|
||||
|
||||
MogoPrivateObuManager.INSTANCE.getMogoObuListener()
|
||||
.onCvxRtiThreatIndInfo(cvxRtiThreatIndInfo)
|
||||
}
|
||||
}
|
||||
// val obuType = intent.getIntExtra(MogoObuConst.BROADCAST_OBU_TYPE_EXTRA_KEY, 0)
|
||||
// val obuStatus = intent.getIntExtra(MogoObuConst.BROADCAST_OBU_STATES_EXTRA_KEY, 0)
|
||||
// val obuLevel = intent.getIntExtra(MogoObuConst.BROADCAST_OBU_LEVEL_EXTRA_KEY, 3)
|
||||
// val indicator = intent.getIntExtra(MogoObuConst.BROADCAST_LIGHT_LEVEL_EXTRA_KEY, 0)
|
||||
// val pctType = intent.getIntExtra(MogoObuConst.BROADCAST_PTC_INFO_EXTRA_KEY, 0)
|
||||
// val rtiType = intent.getIntExtra(MogoObuConst.BROADCAST_RTI_TYPE_EXTRA_KEY, 0)
|
||||
//
|
||||
// CallerLogger.d(
|
||||
// "$M_OBU$TAG", "obuStatus:$obuStatus phase:$indicator obuType:$obuType obuLevel:$obuLevel"
|
||||
// )
|
||||
//
|
||||
// when (obuType) {
|
||||
// ObuConstants.USE_CASE_ID.IVP -> { //构建红绿灯数据
|
||||
// val cvxIvpThreatIndInfo = CvxIvpThreatIndInfo(1, 1, 1L)
|
||||
//
|
||||
// val ivpThreat = IvpThreat(1, obuType, null, 1000, obuLevel, 100)
|
||||
//
|
||||
// cvxIvpThreatIndInfo.threat_info = ivpThreat
|
||||
//
|
||||
// val lightList = listOf(
|
||||
// Light(1, 0x0, 1000, 3000, 6000, 3000, 100, 1000),
|
||||
// Light(1, 0x1, 1000, 3000, 6000, 3000, 100, 1000),
|
||||
// Light(1, 0x2, 1000, 3000, 6000, 3000, 100, 1000),
|
||||
// Light(1, 0x3, 1000, 3000, 6000, 3000, 100, 1000)
|
||||
// )
|
||||
// val ivpThreatExt = IvpThreatExt(1, 1000, 1000, 0, indicator, lightList)
|
||||
// cvxIvpThreatIndInfo.ext_info = ivpThreatExt
|
||||
// cvxIvpThreatIndInfo.status = obuStatus
|
||||
// cvxIvpThreatIndInfo.link_id = "1"
|
||||
//
|
||||
// MogoPrivateObuManager.INSTANCE.getMogoObuListener()
|
||||
// .onCvxIvpThreatIndInfo(cvxIvpThreatIndInfo)
|
||||
// }
|
||||
//
|
||||
// ObuConstants.USE_CASE_ID.SLW -> { //限速预警
|
||||
// val cvxSlwThreatIndInfo = CvxSlwThreatIndInfo(1, 1, 1L)
|
||||
// val slwThreatExt = SlwThreatExt(1, 2, 6000, 2000)
|
||||
//
|
||||
// cvxSlwThreatIndInfo.ext_info = slwThreatExt
|
||||
// cvxSlwThreatIndInfo.status = obuStatus
|
||||
//
|
||||
// MogoPrivateObuManager.INSTANCE.getMogoObuListener()
|
||||
// .onCvxSlwThreatIndInfo(cvxSlwThreatIndInfo)
|
||||
// }
|
||||
//
|
||||
// //弱势交通参与者碰撞预警,行人/摩托车碰撞预警
|
||||
// ObuConstants.USE_CASE_ID.VRUCW -> {
|
||||
// val cvxPtcIndInfo = CvxPtcThreatIndInfo(1, 1, 1)
|
||||
// val position = Position(1, 399739429, 1164115207, 20)
|
||||
// cvxPtcIndInfo.ptc_pos = position
|
||||
// cvxPtcIndInfo.ptc_id = "111"
|
||||
// cvxPtcIndInfo.ptc_type = pctType
|
||||
// cvxPtcIndInfo.status = obuStatus
|
||||
//
|
||||
// val v2vThreat = V2vThreat(1, obuType, null, 1000, obuLevel, 100)
|
||||
// cvxPtcIndInfo.threat_info = v2vThreat
|
||||
//
|
||||
// MogoPrivateObuManager.INSTANCE.getMogoObuListener()
|
||||
// .onCvxPtcThreatIndInfo(cvxPtcIndInfo)
|
||||
// }
|
||||
//
|
||||
// //道路危险情况, 车内标牌, 前方拥堵提醒
|
||||
// ObuConstants.USE_CASE_ID.HLW, ObuConstants.USE_CASE_ID.IVS, ObuConstants.USE_CASE_ID.TJW -> {
|
||||
// val cvxRtiThreatIndInfo = CvxRtiThreatIndInfo(1, 1, 1L)
|
||||
// val dateTime = DateTime(1, 1, 1, 1, 1, 1, 1, 1)
|
||||
// val rtiThread = RtiThreat(1, obuType, dateTime, 100000, obuLevel, 100)
|
||||
// val extInfo = RtiThreatExt(1, rtiType, 0x02, 100000, 100000)
|
||||
// val position = Position(1, 399739429, 1164115207, 20)
|
||||
//
|
||||
// // 位置围栏
|
||||
// val zonesInfo = listOf(
|
||||
// ZoneInfo(1, 2000, 2000, listOf(position))
|
||||
// )
|
||||
//
|
||||
// cvxRtiThreatIndInfo.rti_id = "123123"
|
||||
// cvxRtiThreatIndInfo.zones_info = zonesInfo
|
||||
// cvxRtiThreatIndInfo.threat_info = rtiThread
|
||||
// cvxRtiThreatIndInfo.ext_info = extInfo
|
||||
// cvxRtiThreatIndInfo.status = obuStatus
|
||||
//
|
||||
// MogoPrivateObuManager.INSTANCE.getMogoObuListener()
|
||||
// .onCvxRtiThreatIndInfo(cvxRtiThreatIndInfo)
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,60 @@
|
||||
package com.mogo.eagle.core.function.obu.mogo.receiver
|
||||
|
||||
import android.content.BroadcastReceiver
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.util.Log
|
||||
import com.mogo.eagle.core.function.obu.mogo.MogoPrivateObuNewManager
|
||||
import com.mogo.support.obu.model.MogoObuRvWarningData
|
||||
import com.mogo.support.obu.model.advance.V2xWarning
|
||||
import com.mogo.support.obu.model.advance.VehBasics
|
||||
import com.mogo.support.obu.model.advance.WarningData
|
||||
|
||||
|
||||
/**
|
||||
* @author lixiaopeng
|
||||
* @date 2022/9/8 10:50 上午
|
||||
*
|
||||
* 自研OBU 模拟场景
|
||||
*/
|
||||
class ObuTestNewObuReceiver : BroadcastReceiver() {
|
||||
private var mContext: Context? = null
|
||||
|
||||
companion object {
|
||||
private const val TAG = "ObuTestNewObuReceiver"
|
||||
}
|
||||
|
||||
override fun onReceive(context: Context, intent: Intent) {
|
||||
mContext = context
|
||||
/**
|
||||
* OBU 场景类型
|
||||
* @see com.zhidao.support.obu.constants.ObuConstants.USE_CASE_ID
|
||||
*/
|
||||
val obuType = intent.getIntExtra("type", 0)
|
||||
val obuStatus = intent.getIntExtra("status", 0)
|
||||
val obuLevel = intent.getIntExtra("level", 3)
|
||||
val direction = intent.getIntExtra("direction", 0)
|
||||
Log.d("liyz", "obuType:$obuType obuStatus:$obuStatus obuLevel:$obuLevel")
|
||||
|
||||
val vehBasicsMsg = VehBasics(1)
|
||||
vehBasicsMsg.targetPosition = direction
|
||||
|
||||
val warningMsg = V2xWarning(1)
|
||||
|
||||
val warningData1 = WarningData(1, 2)
|
||||
warningData1.warningType = obuType
|
||||
warningData1.warningLevel = obuLevel
|
||||
// val warningData2 = WarningData(1, 3)
|
||||
|
||||
val warningList = listOf(warningData1)
|
||||
warningMsg.warningData = warningList
|
||||
|
||||
val cvxHvInfoIndInfo = MogoObuRvWarningData(0, vehBasicsMsg, warningMsg)
|
||||
|
||||
MogoPrivateObuNewManager.INSTANCE
|
||||
.getMogoObuListener()
|
||||
.onMogoObuRvWarning(cvxHvInfoIndInfo)
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -3,17 +3,17 @@ package com.mogo.eagle.core.function.obu.mogo.receiver
|
||||
import android.content.BroadcastReceiver
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import com.mogo.eagle.core.function.obu.mogo.MogoObuConst
|
||||
import com.mogo.eagle.core.function.obu.mogo.MogoPrivateObuManager
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_OBU
|
||||
import com.zhidao.support.obu.constants.ObuConstants
|
||||
import com.zhidao.support.obu.model.CvxV2vThreatIndInfo
|
||||
import com.zhidao.support.obu.model.advance.MovingObjectInfo
|
||||
import com.zhidao.support.obu.model.advance.Position
|
||||
import com.zhidao.support.obu.model.advance.V2vThreat
|
||||
import com.zhidao.support.obu.model.advance.V2vThreatExt
|
||||
import kotlin.random.Random
|
||||
//import com.mogo.eagle.core.function.obu.mogo.MogoObuConst
|
||||
//import com.mogo.eagle.core.function.obu.mogo.MogoPrivateObuManager
|
||||
//import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
//import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_OBU
|
||||
//import com.zhidao.support.obu.constants.ObuConstants
|
||||
//import com.zhidao.support.obu.model.CvxV2vThreatIndInfo
|
||||
//import com.zhidao.support.obu.model.advance.MovingObjectInfo
|
||||
//import com.zhidao.support.obu.model.advance.Position
|
||||
//import com.zhidao.support.obu.model.advance.V2vThreat
|
||||
//import com.zhidao.support.obu.model.advance.V2vThreatExt
|
||||
//import kotlin.random.Random
|
||||
|
||||
/**
|
||||
* @author xiaoyuzhou
|
||||
@@ -29,61 +29,61 @@ class ObuTestTriggerReceiver : BroadcastReceiver() {
|
||||
}
|
||||
|
||||
override fun onReceive(context: Context, intent: Intent) {
|
||||
mContext = context
|
||||
/**
|
||||
* OBU 场景类型
|
||||
* @see com.zhidao.support.obu.constants.ObuConstants.USE_CASE_ID
|
||||
*/
|
||||
val obuType = intent.getIntExtra(MogoObuConst.BROADCAST_OBU_TYPE_EXTRA_KEY, 0)
|
||||
val obuStatus = intent.getIntExtra(MogoObuConst.BROADCAST_OBU_STATES_EXTRA_KEY, 0)
|
||||
val obuLevel = intent.getIntExtra(MogoObuConst.BROADCAST_OBU_LEVEL_EXTRA_KEY, 3)
|
||||
val obuDirection =
|
||||
intent.getIntExtra(MogoObuConst.BROADCAST_OBU_EVENT_DIRECTION_EXTRA_KEY, 0x11)
|
||||
CallerLogger.d(
|
||||
"$M_OBU$TAG", "obuType:$obuType obuStatus:$obuStatus obuDirection$obuDirection"
|
||||
)
|
||||
|
||||
when (obuType) {
|
||||
ObuConstants.USE_CASE_ID.EBW, ObuConstants.USE_CASE_ID.FCW, ObuConstants.USE_CASE_ID.ICW,
|
||||
ObuConstants.USE_CASE_ID.CLW, ObuConstants.USE_CASE_ID.DNPW, ObuConstants.USE_CASE_ID.AVW,
|
||||
ObuConstants.USE_CASE_ID.BSW, ObuConstants.USE_CASE_ID.LCW, ObuConstants.USE_CASE_ID.EVW, ObuConstants.USE_CASE_ID.VRUCW,
|
||||
ObuConstants.USE_CASE_ID.SLW, ObuConstants.USE_CASE_ID.LTA, ObuConstants.USE_CASE_ID.HLW, ObuConstants.USE_CASE_ID.IVS,
|
||||
ObuConstants.USE_CASE_ID.TJW, ObuConstants.USE_CASE_ID.IVP, ObuConstants.USE_CASE_ID.COC -> {
|
||||
|
||||
// 构建测试数据
|
||||
val cvxV2vThreatIndInfo = CvxV2vThreatIndInfo(1, 1, 1L)
|
||||
|
||||
val v2vThreat = V2vThreat(1, obuType, null, 1000, obuLevel, 100)
|
||||
cvxV2vThreatIndInfo.threat_info = v2vThreat
|
||||
|
||||
val v2vThreatExt =
|
||||
V2vThreatExt(
|
||||
1, 1, obuDirection, 1, 1
|
||||
)
|
||||
cvxV2vThreatIndInfo.ext_info = v2vThreatExt
|
||||
cvxV2vThreatIndInfo.status = obuStatus
|
||||
cvxV2vThreatIndInfo.vehicle_id = "123321"
|
||||
|
||||
|
||||
// 设置位置
|
||||
val randomLocation = Random.nextInt(100, 2000)
|
||||
|
||||
val position = Position(
|
||||
0, (399739429 + randomLocation).toLong(),
|
||||
(1164115207 + randomLocation).toLong(), 20
|
||||
)
|
||||
val movingObjectInfo = MovingObjectInfo(
|
||||
0,
|
||||
position,
|
||||
1800 +randomLocation,
|
||||
6000 +randomLocation
|
||||
)
|
||||
cvxV2vThreatIndInfo.basic_info = movingObjectInfo
|
||||
|
||||
MogoPrivateObuManager.INSTANCE.getMogoObuListener()
|
||||
.onCvxV2vThreatIndInfo(cvxV2vThreatIndInfo)
|
||||
}
|
||||
}
|
||||
// mContext = context
|
||||
// /**
|
||||
// * OBU 场景类型
|
||||
// * @see com.zhidao.support.obu.constants.ObuConstants.USE_CASE_ID
|
||||
// */
|
||||
// val obuType = intent.getIntExtra(MogoObuConst.BROADCAST_OBU_TYPE_EXTRA_KEY, 0)
|
||||
// val obuStatus = intent.getIntExtra(MogoObuConst.BROADCAST_OBU_STATES_EXTRA_KEY, 0)
|
||||
// val obuLevel = intent.getIntExtra(MogoObuConst.BROADCAST_OBU_LEVEL_EXTRA_KEY, 3)
|
||||
// val obuDirection =
|
||||
// intent.getIntExtra(MogoObuConst.BROADCAST_OBU_EVENT_DIRECTION_EXTRA_KEY, 0x11)
|
||||
// CallerLogger.d(
|
||||
// "$M_OBU$TAG", "obuType:$obuType obuStatus:$obuStatus obuDirection$obuDirection"
|
||||
// )
|
||||
//
|
||||
// when (obuType) {
|
||||
// ObuConstants.USE_CASE_ID.EBW, ObuConstants.USE_CASE_ID.FCW, ObuConstants.USE_CASE_ID.ICW,
|
||||
// ObuConstants.USE_CASE_ID.CLW, ObuConstants.USE_CASE_ID.DNPW, ObuConstants.USE_CASE_ID.AVW,
|
||||
// ObuConstants.USE_CASE_ID.BSW, ObuConstants.USE_CASE_ID.LCW, ObuConstants.USE_CASE_ID.EVW, ObuConstants.USE_CASE_ID.VRUCW,
|
||||
// ObuConstants.USE_CASE_ID.SLW, ObuConstants.USE_CASE_ID.LTA, ObuConstants.USE_CASE_ID.HLW, ObuConstants.USE_CASE_ID.IVS,
|
||||
// ObuConstants.USE_CASE_ID.TJW, ObuConstants.USE_CASE_ID.IVP, ObuConstants.USE_CASE_ID.COC -> {
|
||||
//
|
||||
// // 构建测试数据
|
||||
// val cvxV2vThreatIndInfo = CvxV2vThreatIndInfo(1, 1, 1L)
|
||||
//
|
||||
// val v2vThreat = V2vThreat(1, obuType, null, 1000, obuLevel, 100)
|
||||
// cvxV2vThreatIndInfo.threat_info = v2vThreat
|
||||
//
|
||||
// val v2vThreatExt =
|
||||
// V2vThreatExt(
|
||||
// 1, 1, obuDirection, 1, 1
|
||||
// )
|
||||
// cvxV2vThreatIndInfo.ext_info = v2vThreatExt
|
||||
// cvxV2vThreatIndInfo.status = obuStatus
|
||||
// cvxV2vThreatIndInfo.vehicle_id = "123321"
|
||||
//
|
||||
//
|
||||
// // 设置位置
|
||||
// val randomLocation = Random.nextInt(100, 2000)
|
||||
//
|
||||
// val position = Position(
|
||||
// 0, (399739429 + randomLocation).toLong(),
|
||||
// (1164115207 + randomLocation).toLong(), 20
|
||||
// )
|
||||
// val movingObjectInfo = MovingObjectInfo(
|
||||
// 0,
|
||||
// position,
|
||||
// 1800 +randomLocation,
|
||||
// 6000 +randomLocation
|
||||
// )
|
||||
// cvxV2vThreatIndInfo.basic_info = movingObjectInfo
|
||||
//
|
||||
// MogoPrivateObuManager.INSTANCE.getMogoObuListener()
|
||||
// .onCvxV2vThreatIndInfo(cvxV2vThreatIndInfo)
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
||||
}
|
||||
@@ -3,14 +3,14 @@ package com.mogo.eagle.core.function.obu.mogo.receiver
|
||||
import android.content.BroadcastReceiver
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import com.mogo.eagle.core.function.obu.mogo.MogoObuConst
|
||||
import com.mogo.eagle.core.function.obu.mogo.MogoPrivateObuManager
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_OBU
|
||||
import com.zhidao.support.obu.model.CvxHvInfoIndInfo
|
||||
import com.zhidao.support.obu.model.advance.MovingObjectInfo
|
||||
import com.zhidao.support.obu.model.advance.Position
|
||||
import kotlin.random.Random
|
||||
//import com.mogo.eagle.core.function.obu.mogo.MogoObuConst
|
||||
//import com.mogo.eagle.core.function.obu.mogo.MogoPrivateObuManager
|
||||
//import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
//import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_OBU
|
||||
//import com.zhidao.support.obu.model.CvxHvInfoIndInfo
|
||||
//import com.zhidao.support.obu.model.advance.MovingObjectInfo
|
||||
//import com.zhidao.support.obu.model.advance.Position
|
||||
//import kotlin.random.Random
|
||||
|
||||
/**
|
||||
* @author xiaoyuzhou
|
||||
@@ -31,30 +31,30 @@ class ObuTestTriggerRecognizedReceiver : BroadcastReceiver() {
|
||||
* OBU 场景类型
|
||||
* @see com.zhidao.support.obu.constants.ObuConstants.USE_CASE_ID
|
||||
*/
|
||||
val obuType = intent.getIntExtra(MogoObuConst.BROADCAST_OBU_TYPE_EXTRA_KEY, 0)
|
||||
val obuStatus = intent.getIntExtra(MogoObuConst.BROADCAST_OBU_STATES_EXTRA_KEY, 0)
|
||||
val obuLevel = intent.getIntExtra(MogoObuConst.BROADCAST_OBU_LEVEL_EXTRA_KEY, 3)
|
||||
CallerLogger.d("$M_OBU$TAG", "obuType:$obuType obuStatus:$obuStatus obuLevel:$obuLevel")
|
||||
|
||||
val cvxHvInfoIndInfo = CvxHvInfoIndInfo(0, 1, 2)
|
||||
|
||||
val randomLocation = Random.nextInt(100, 2000)
|
||||
|
||||
val position = Position(
|
||||
0, (399739429 + randomLocation).toLong(),
|
||||
(1164115207 + randomLocation).toLong(), 20
|
||||
)
|
||||
val movingObjectInfo = MovingObjectInfo(
|
||||
0,
|
||||
position,
|
||||
1800 +randomLocation,
|
||||
6000 +randomLocation
|
||||
)
|
||||
cvxHvInfoIndInfo.basic_info = movingObjectInfo
|
||||
|
||||
MogoPrivateObuManager.INSTANCE
|
||||
.getMogoObuListener()
|
||||
.onCvxHvInfoIndInfo(cvxHvInfoIndInfo)
|
||||
// val obuType = intent.getIntExtra(MogoObuConst.BROADCAST_OBU_TYPE_EXTRA_KEY, 0)
|
||||
// val obuStatus = intent.getIntExtra(MogoObuConst.BROADCAST_OBU_STATES_EXTRA_KEY, 0)
|
||||
// val obuLevel = intent.getIntExtra(MogoObuConst.BROADCAST_OBU_LEVEL_EXTRA_KEY, 3)
|
||||
// CallerLogger.d("$M_OBU$TAG", "obuType:$obuType obuStatus:$obuStatus obuLevel:$obuLevel")
|
||||
//
|
||||
// val cvxHvInfoIndInfo = CvxHvInfoIndInfo(0, 1, 2)
|
||||
//
|
||||
// val randomLocation = Random.nextInt(100, 2000)
|
||||
//
|
||||
// val position = Position(
|
||||
// 0, (399739429 + randomLocation).toLong(),
|
||||
// (1164115207 + randomLocation).toLong(), 20
|
||||
// )
|
||||
// val movingObjectInfo = MovingObjectInfo(
|
||||
// 0,
|
||||
// position,
|
||||
// 1800 +randomLocation,
|
||||
// 6000 +randomLocation
|
||||
// )
|
||||
// cvxHvInfoIndInfo.basic_info = movingObjectInfo
|
||||
//
|
||||
// MogoPrivateObuManager.INSTANCE
|
||||
// .getMogoObuListener()
|
||||
// .onCvxHvInfoIndInfo(cvxHvInfoIndInfo)
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,143 @@
|
||||
package com.mogo.eagle.core.function.obu.mogo.utils
|
||||
|
||||
import android.util.Log
|
||||
import com.mogo.eagle.core.data.enums.TrafficTypeEnum
|
||||
import com.mogo.eagle.core.data.traffic.TrafficData
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_OBU
|
||||
import com.mogo.support.obu.model.MogoObuRsiWarningData
|
||||
import com.mogo.support.obu.model.MogoObuRsmWarningData
|
||||
import com.mogo.support.obu.model.MogoObuRvWarningData
|
||||
|
||||
/**
|
||||
* @description 自研obu数据转换
|
||||
*
|
||||
* @author lixiaopeng
|
||||
* @since 2022/8/24
|
||||
*/
|
||||
object TrafficDataConvertUtilsNew {
|
||||
val TAG = "TrafficDataConvertUtilsNew"
|
||||
|
||||
/**
|
||||
* OBU 远车 转换交通元素数据,是否需要 TODO
|
||||
*/
|
||||
fun cvxRvInfoIndInfo2TrafficData(info: MogoObuRvWarningData): TrafficData? {
|
||||
if (info.vehBasicsMsg == null) {
|
||||
Log.e("liyz", "cvxRvInfoIndInfo2TrafficData info.vehBasicsMsg == null ")
|
||||
CallerLogger.e("$M_OBU$TAG", "cvxRvInfoIndInfo2TrafficData 数据转换异常,请检查参数是否齐全")
|
||||
return null
|
||||
}
|
||||
val trafficData = TrafficData()
|
||||
trafficData.type = TrafficTypeEnum.TYPE_TRAFFIC_ID_TA_CHE
|
||||
trafficData.uuid = info.vehBasicsMsg.id
|
||||
trafficData.lat = info.vehBasicsMsg.latitude
|
||||
trafficData.lon = info.vehBasicsMsg.longitude
|
||||
trafficData.heading = info.vehBasicsMsg.heading
|
||||
trafficData.speed = info.vehBasicsMsg.speed
|
||||
|
||||
return trafficData
|
||||
}
|
||||
|
||||
/**
|
||||
* OBU RSU道路事件预警信息 转换交通元素数据 标牌 为何要显示level
|
||||
*/
|
||||
fun cvxRtiThreatIndInfo2TrafficData(info: MogoObuRsiWarningData): TrafficData? {
|
||||
if (info.warning_Msg == null || info.warning_Msg.size < 1 || info.warning_Msg[0].position == null) {
|
||||
CallerLogger.e("$M_OBU$TAG", "数据转换异常,请检查参数是否齐全")
|
||||
Log.e("liyz", "cvxRtiThreatIndInfo2TrafficData info.warning_Msg == null ")
|
||||
return null
|
||||
}
|
||||
val trafficData = TrafficData()
|
||||
trafficData.type = TrafficTypeEnum.TYPE_TRAFFIC_ID_DAO_LU_SHI_GONG
|
||||
trafficData.uuid = info.warning_Msg[0].signSerialNum.toString()
|
||||
trafficData.lat = info.warning_Msg[0].position.latitude
|
||||
trafficData.lon = info.warning_Msg[0].position.longitude
|
||||
trafficData.threatLevel = info.warning_Msg[0].warningLevel
|
||||
Log.e("liyz", "cvxRtiThreatIndInfo2TrafficData trafficData -- ${trafficData.toString()}")
|
||||
return trafficData
|
||||
}
|
||||
|
||||
/**
|
||||
* OBU 预警事件 转换交通元素数据 他车预警
|
||||
*/
|
||||
fun cvxV2vThreatIndInfo2TrafficData(info: MogoObuRvWarningData): TrafficData? {
|
||||
if (info == null || info.vehBasicsMsg == null || info.warningMsg == null) {
|
||||
CallerLogger.e("$M_OBU$TAG", "数据转换异常,请检查参数是否齐全")
|
||||
Log.e("liyz", "cvxV2vThreatIndInfo2TrafficData info == null ")
|
||||
return null
|
||||
}
|
||||
val trafficData = TrafficData()
|
||||
trafficData.uuid = info.vehBasicsMsg.id
|
||||
trafficData.lat = info.vehBasicsMsg.latitude
|
||||
trafficData.lon = info.vehBasicsMsg.longitude
|
||||
trafficData.heading = info.vehBasicsMsg.heading
|
||||
trafficData.speed = info.vehBasicsMsg.speed
|
||||
// 判断车辆V2X预警级别,调整车辆颜色
|
||||
if (info.warningMsg.warningData != null) {
|
||||
trafficData.threatLevel = info.warningMsg.warningData[0].warningLevel
|
||||
} else {
|
||||
trafficData.threatLevel = 1
|
||||
}
|
||||
|
||||
trafficData.type = TrafficTypeEnum.TYPE_TRAFFIC_ID_TA_CHE
|
||||
Log.e("liyz", "cvxV2vThreatIndInfo2TrafficData trafficData = ${trafficData.toString()} ")
|
||||
|
||||
return trafficData
|
||||
}
|
||||
|
||||
/**
|
||||
* OBU 弱势交通参与者信息 转换交通元素数据
|
||||
*/
|
||||
fun cvxPtcThreatIndInfo2TrafficData(info: MogoObuRsmWarningData): TrafficData? {
|
||||
if (info.participant == null) {
|
||||
CallerLogger.e("$M_OBU$TAG", "数据转换异常,请检查参数是否齐全")
|
||||
Log.e("liyz", "cvxPtcThreatIndInfo2TrafficData info.participant ")
|
||||
return null
|
||||
}
|
||||
val trafficData = TrafficData()
|
||||
trafficData.uuid = info.participant.ptcId.toString()
|
||||
trafficData.lat = info.participant.latitude
|
||||
trafficData.lon = info.participant.longitude
|
||||
trafficData.heading = info.participant.heading
|
||||
trafficData.speed = info.participant.speed
|
||||
|
||||
when (info.participant.ptcType) {
|
||||
// 未知
|
||||
0 -> {
|
||||
trafficData.type = TrafficTypeEnum.TYPE_TRAFFIC_ID_WEI_ZHI
|
||||
}
|
||||
//机动车 //TODO
|
||||
1 -> {
|
||||
trafficData.type = TrafficTypeEnum.TYPE_TRAFFIC_ID_TA_CHE
|
||||
}
|
||||
// 非机动车
|
||||
2 -> {
|
||||
trafficData.type = TrafficTypeEnum.TYPE_TRAFFIC_ID_BICYCLE
|
||||
}
|
||||
// 行人
|
||||
3 -> {
|
||||
trafficData.type = TrafficTypeEnum.TYPE_TRAFFIC_ID_PEOPLE
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 交通参与者类型
|
||||
* 0:未知
|
||||
* 1:机动车
|
||||
* 2:非机动车
|
||||
* 3:行人
|
||||
* 4:OBU自身
|
||||
*/
|
||||
val ptcType = 0
|
||||
|
||||
// 判断车辆V2X预警级别,调整车辆颜色
|
||||
if (info.m_warning_msg != null && info.m_warning_msg.warningData != null) {
|
||||
trafficData.threatLevel = info.m_warning_msg.warningData[0].warningLevel
|
||||
} else {
|
||||
trafficData.threatLevel = 1
|
||||
}
|
||||
Log.e("liyz", "cvxPtcThreatIndInfo2TrafficData trafficData = ${trafficData.toString()} ")
|
||||
return trafficData
|
||||
}
|
||||
|
||||
}
|
||||
@@ -4,6 +4,7 @@ import com.mogo.eagle.core.data.R
|
||||
import com.mogo.eagle.core.data.config.CloudPoiManager
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* OBU、V2N事件类型枚举类
|
||||
*/
|
||||
|
||||
@@ -24,7 +24,7 @@ enum class TrafficTypeEnum(
|
||||
R.raw.traffic_xiankuang
|
||||
),
|
||||
TYPE_TRAFFIC_ID_PEOPLE(
|
||||
1,
|
||||
3,
|
||||
"人",
|
||||
R.raw.traffic_people,
|
||||
R.raw.xingren,
|
||||
|
||||
@@ -145,10 +145,10 @@ object CallerDevaToolsManager {
|
||||
* 下载指定包
|
||||
*/
|
||||
fun downLoadPackage(downloadKey: String, downloadUrl: String) {
|
||||
devaToolsProviderApi?.downLoadPackage(downloadKey, downloadUrl)
|
||||
// devaToolsProviderApi?.downLoadPackage(downloadKey, downloadUrl)
|
||||
// Log.d("Update", "downloadKey = $downloadKey --- downloadUrl = $downloadUrl")
|
||||
// devaToolsProviderApi?.downLoadPackage("IntelligentPilot_v2.9.0.1002_20220725_[fPadLenovoOchBus-launcher-qa]_debug.apk", "https://scm-1255510688.cos.ap-beijing.myqcloud.com/test/com.mogo.launcher.f/2.9.0.1002/IntelligentPilot_v2.9.0.1002_20220725_[fPadLenovoOchBus-launcher-qa]_debug.apk")
|
||||
// devaToolsProviderApi?.downLoadPackage("IntelligentPilot_v2.10.0_20220921_[fPadLenovoOchBus-launcher-qa]_debug.apk", "http://datacollect-1255510688.cos.ap-beijing.myqcloud.com/eagle_eye_apk/a657ca047711d61fe43c5f54a2e3e2dd/IntelligentPilot_v2.10.0_20220921_%5BfPadLenovoOchBus-launcher-qa%5D_debug.apk?sign=q-sign-algorithm%3Dsha1%26q-ak%3DAKIDvGBZgjPVm09B7sjyTPL7najBQMB7baBb%26q-sign-time%3D1663916659%3B1666508659%26q-key-time%3D1663916659%3B1666508659%26q-header-list%3Dhost%26q-url-param-list%3D%26q-signature%3Dd2f97c31465c161ae3960166564affeca5464fbf&filename=/IntelligentPilot_v2.10.0_20220921_[fPadLenovoOchBus-launcher-qa]_debug.apk")
|
||||
devaToolsProviderApi?.downLoadPackage("IntelligentPilot_v2.9.0.1002_20220725_[fPadLenovoOchBus-launcher-qa]_debug.apk", "https://scm-1255510688.cos.ap-beijing.myqcloud.com/test/com.mogo.launcher.f/2.9.0.1002/IntelligentPilot_v2.9.0.1002_20220725_[fPadLenovoOchBus-launcher-qa]_debug.apk")
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -155,7 +155,6 @@ public class DownloadService implements InitThread.InitCallBack, DownloadCallBac
|
||||
@Override
|
||||
public void threadDownLoadFinished(String url, ThreadBean threadBean) {
|
||||
IDownload iDownload = callBacks.get(url);
|
||||
Log.d(DOWN_LOAD_TAG, "iDownload threadDownLoadFinished = " + iDownload);
|
||||
if (iDownload != null) {
|
||||
iDownload.onFinished(url, threadBean);
|
||||
}
|
||||
|
||||
@@ -119,6 +119,7 @@ public class DownloadTask implements DownloadCallBack {
|
||||
//每500毫秒发送刷新进度事件
|
||||
if (System.currentTimeMillis() - curTime > 500 || finishedProgress == fileBean.getLength()) {
|
||||
int progress = (int) (finishedProgress * 1.0 / fileBean.getLength() * 100);
|
||||
// Log.d(DOWN_LOAD_TAG, "DownloadTask ----length = " + length + " ---progress = " + progress);
|
||||
fileBean.setFinished(finishedProgress);
|
||||
DownloadData downloadData = new DownloadData();
|
||||
downloadData.setUrl(fileBean.getUrl());
|
||||
@@ -142,7 +143,7 @@ public class DownloadTask implements DownloadCallBack {
|
||||
}
|
||||
}
|
||||
if (threads.size() == 0) {//如果列表size为0 则所有线程已下载完成
|
||||
Log.d(DOWN_LOAD_TAG, "下载完成----->");
|
||||
Log.d(DOWN_LOAD_TAG, " DownloadTask threadDownLoadFinished 下载完成----->");
|
||||
//删除数据库中的信息
|
||||
dao.deleteThread(fileBean.getUrl());
|
||||
//发送下载完成事件
|
||||
|
||||
@@ -23,6 +23,7 @@ import java.io.InputStreamReader;
|
||||
import java.io.LineNumberReader;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.lang.reflect.Field;
|
||||
import java.net.Inet4Address;
|
||||
import java.net.InetAddress;
|
||||
import java.net.NetworkInterface;
|
||||
import java.net.SocketException;
|
||||
@@ -397,8 +398,27 @@ public class CommonUtils {
|
||||
|
||||
}
|
||||
|
||||
public static String getIpAddressString() {
|
||||
try {
|
||||
for (Enumeration<NetworkInterface> enNetI = NetworkInterface
|
||||
.getNetworkInterfaces(); enNetI.hasMoreElements(); ) {
|
||||
NetworkInterface netI = enNetI.nextElement();
|
||||
for (Enumeration<InetAddress> enumIpAddr = netI
|
||||
.getInetAddresses(); enumIpAddr.hasMoreElements(); ) {
|
||||
InetAddress inetAddress = enumIpAddr.nextElement();
|
||||
if (inetAddress instanceof Inet4Address && !inetAddress.isLoopbackAddress()) {
|
||||
return inetAddress.getHostAddress();
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (SocketException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return "127.0.0.1";
|
||||
}
|
||||
|
||||
// 获取本地IP函数
|
||||
private static String getLocalIPAddress() {
|
||||
public static String getLocalIPAddress() {
|
||||
try {
|
||||
Enumeration<NetworkInterface> mEnumeration = NetworkInterface.getNetworkInterfaces();
|
||||
if (mEnumeration != null) {
|
||||
|
||||
@@ -93,8 +93,8 @@ WEBSOCKET_VERSION=1.1.7
|
||||
applicationId=com.mogo.launcer
|
||||
applicationName=IntelligentPilot
|
||||
# RoboBus司机端:2.5.1;RoboTaxi司机端:2.5.1;RoboTaxi乘客端:1.0.0
|
||||
versionCode=2120000
|
||||
versionName=2.12.0
|
||||
versionCode=2130000
|
||||
versionName=2.13.0
|
||||
|
||||
################# 新架构模块Maven版本管理 #################
|
||||
MOGO_CORE_FUNCTION_AUTOPILOT_VERSION=0.0.58.10
|
||||
|
||||
@@ -2,7 +2,7 @@ package com.zhidao.support.adas.high.common;
|
||||
|
||||
/**
|
||||
* 监控事件报告中定义的事件以及解释
|
||||
* 根据290消息定义编写
|
||||
* 根据MAP2.10.0消息定义编写
|
||||
*/
|
||||
public class MogoReport {
|
||||
public static final String RESULT_AUTOPILOT_SYSTEM_UNSTARTED = "RESULT_AUTOPILOT_SYSTEM_UNSTARTED";
|
||||
@@ -252,6 +252,18 @@ public class MogoReport {
|
||||
String CAN_MSG_LOST = "ESYS_CAN_MSG_LOST";//master接收底盘消息超时
|
||||
}
|
||||
|
||||
/**
|
||||
* 系统异常状态上报
|
||||
*/
|
||||
interface ESSM {
|
||||
String IN_INIT = "ESSM_IN_INIT";//SSM初始化,非任何模式,拒绝进入自动驾驶/平行驾驶
|
||||
String IN_EXIT = "ESSM_IN_EXIT";//SSM处于停止模式,拒绝进入自动驾驶/平行驾驶
|
||||
String AUTOPILOT_UNREADY = "ESSM_AUTOPILOT_UNREADY";//因自动驾驶状态未就绪拒绝自驾
|
||||
String REMOTEPILOT_UNREADY = "ESSM_REMOTEPILOT_UNREADY";//因平行驾驶状态未就绪拒绝平行驾驶
|
||||
String MAP_IMAGE_DIFF = "ESSM_MAP_IMAGE_DIFF";//同镜像Agent存在版本不一致的问题
|
||||
String COLD_START_TIMEOUT = "ESSM_COLD_START_TIMEOUT";//系统冷启动超时未完成
|
||||
}
|
||||
|
||||
interface EAGENT {
|
||||
String FATAL = "EAGENT_FATAL";//agent严重故障,无法恢复
|
||||
String MASTER_COMMAND_HANDLER_FAILED = "EAGENT_MASTER_COMMAND_HANDLER_FAILED";//agent未能成功执行master指令
|
||||
@@ -273,6 +285,24 @@ public class MogoReport {
|
||||
String RTK_STATUS_FAULT = "ELCT_RTK_STATUS_FAULT";//RTK状态错误
|
||||
String RTK_STATUS_UNKNOWN = "ELCT_RTK_STATUS_UNKNOWN";//RTK状态不确定
|
||||
}
|
||||
|
||||
/**
|
||||
* 推流异常
|
||||
*/
|
||||
interface EPUSH {
|
||||
String VIDEO_INIT_ERROR = "EPUSH_VIDEO_INIT_ERROR";//初始化失败
|
||||
String VIDEO_START_SERVICE_ERROR = "EPUSH_VIDEO_START_SERVICE_ERROR";//启动服务失败
|
||||
}
|
||||
|
||||
/**
|
||||
* 录包异常
|
||||
*/
|
||||
interface ERECORD {
|
||||
String TASK_BAG_INIT = "ERECORD_TASK_BAG_INIT";//包初始化失败
|
||||
String TASK_SPACE = "ERECORD_TASK_SPACE";//空间不足
|
||||
String TASK_CONFIG_EMPTY = "ERECORD_TASK_CONFIG_EMPTY";//配置为空
|
||||
String TASK_QUEUE_EMPTY = "ERECORD_TASK_QUEUE_EMPTY";//数据队列为空
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -331,14 +361,42 @@ public class MogoReport {
|
||||
String REOMTEPILOT_RUNING = "ISYS_REOMTEPILOT_RUNING";//平行驾驶运行中
|
||||
String SYSTEM_IN_IDLE = "ISYS_SYSTEM_IN_IDLE";//系统进入空闲状态
|
||||
String SYSTEM_OUT_IDLE = "ISYS_SYSTEM_OUT_IDLE";//系统退出空闲状态
|
||||
|
||||
String FUNC_YY_START = "ISYS_FUNC_YY_START";//产品状态检查开始
|
||||
String FUNC_YY_FINISH = "ISYS_FUNC_YY_FINISH";//产品状态达成(第一次ready)
|
||||
String FUNC_YY_TIMEOUT = "ISYS_FUNC_YY_TIMEOUT";//产品状态检查超时
|
||||
String FUNC_YY_ABORT = "ISYS_FUNC_YY_ABORT";//产品状态检查中止
|
||||
String FUNC_YY_UNREADY = "ISYS_FUNC_YY_UNREADY";//产品状态未就绪
|
||||
String FUNC_YY_READY = "ISYS_FUNC_YY_READY";//产品状态就绪
|
||||
|
||||
String INIT_TRAJECTORY_START = "ISYS_INIT_TRAJECTORY_START";//轨迹管理_轨迹开始下载
|
||||
String INIT_TRAJECTORY_SUCCESS = "ISYS_INIT_TRAJECTORY_SUCCESS";//轨迹管理_轨迹下载成功
|
||||
String INIT_TRAJECTORY_FAILURE = "ISYS_INIT_TRAJECTORY_FAILURE";//轨迹管理_轨迹下载失败,本地无对应轨迹
|
||||
String INIT_TRAJECTORY_WARNING = "ISYS_INIT_TRAJECTORY_WARNING";//轨迹管理_轨迹下载失败,本地有对应轨迹,认为成功
|
||||
String INIT_TRAJECTORY_TIMEOUT = "ISYS_INIT_TRAJECTORY_TIMEOUT";//轨迹管理_轨迹下载超时
|
||||
|
||||
String CONFIG_UPDATE_HADMAP = "ISYS_CONFIG_UPDATE_HADMAP";//需要重启升级高精地图
|
||||
String CONFIG_UPDATE_AI_MODEL = "ISYS_CONFIG_UPDATE_AI_MODEL";//需要重启升级AI模型
|
||||
String CONFIG_UPDATE_SLAM_MAP = "ISYS_CONFIG_UPDATE_SLAM_MAP";//需要重启升级SLAM地图
|
||||
String CONFIG_UPDATING_HD_MAP = "ISYS_CONFIG_UPDATING_HD_MAP";//高精地图更新中
|
||||
String CONFIG_UPDATING_SLAM_MAP = "ISYS_CONFIG_UPDATING_SLAM_MAP";//slam 地图更新中
|
||||
String CONFIG_UPDATING_AI_MODEL = "ISYS_CONFIG_UPDATING_AI_MODEL";//AI模型更新中
|
||||
String CONFIG_UPDATING_GRID_MAP = "ISYS_CONFIG_UPDATING_GRID_MAP";//珊格地图更新中
|
||||
}
|
||||
|
||||
/**
|
||||
* 系统状态 常规信息
|
||||
*/
|
||||
interface ISSM {
|
||||
String INIT = "ISSM_INIT";//SSM系统上电初始化
|
||||
String RESTARTED = "ISSM_RESTARTED";//SSM系统发生重启
|
||||
String MODE_XX_START = "ISSM_MODE_XX_START";//SSM变更模式开始
|
||||
String MODE_XX_FINISH = "ISSM_MODE_XX_FINISH";//SSM变更模式完成(第一次ready
|
||||
String MODE_XX_ABORT = "ISSM_MODE_XX_ABORT";//SSM变更模式中止
|
||||
String MODE_XX_TIMEOUT = "ISSM_MODE_XX_TIMEOUT";//SSM变更模式超时
|
||||
String MODE_XX_READY = "ISSM_MODE_XX_READY";//SSM模式就绪
|
||||
String MODE_XX_UNREADY = "ISSM_MODE_XX_UNREADY";//SSM未就绪
|
||||
|
||||
}
|
||||
|
||||
interface IAGENT {
|
||||
@@ -353,6 +411,22 @@ public class MogoReport {
|
||||
String RTK_STATUS_NORMAL = "ILCT_RTK_STATUS_NORMAL";//rtk状态正常或恢复正常
|
||||
String RTK_OR_SLAM_CHANGE = "ILCT_RTK_OR_SLAM_CHANGE";//定位输出源发生RTK和SLAM变换
|
||||
}
|
||||
|
||||
/**
|
||||
* 推流状态
|
||||
*/
|
||||
interface IPUSH {
|
||||
String VIDEO_INIT_SUCCESS = "IPUSH_VIDEO_INIT_SUCCESS";//推流初始化成功
|
||||
String VIDEO_START_SERVICE_SUCCESS = "IPUSH_VIDEO_START_SERVICE_SUCCESS";//推流服务启动成功
|
||||
}
|
||||
|
||||
/**
|
||||
* 录包状态
|
||||
*/
|
||||
interface IRECORDER {
|
||||
String TASK_AUTO = "IRECORDER_TASK_AUTO";//自动录包任务创建
|
||||
String TASK_CMD = "IRECORDER_TASK_CMD";//指令录包任务创建
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -58,6 +58,7 @@ dependencies {
|
||||
implementation rootProject.ext.dependencies.coroutinesandroid
|
||||
implementation rootProject.ext.dependencies.coroutinescore
|
||||
|
||||
implementation rootProject.ext.dependencies.mogoobuold
|
||||
implementation rootProject.ext.dependencies.mogoobu
|
||||
|
||||
annotationProcessor 'com.elegant.spi:compiler:1.0.3'
|
||||
|
||||
@@ -0,0 +1,867 @@
|
||||
package com.mogo.module.common.enums
|
||||
|
||||
import com.mogo.module.common.R
|
||||
import com.mogo.module.common.utils.CloudPoiManager
|
||||
import com.mogo.support.obu.constants.MogoObuConstants
|
||||
|
||||
/**
|
||||
* OBU、V2N事件类型枚举类
|
||||
*/
|
||||
enum class EventTypeEnumNew(
|
||||
val poiType: String, val poiTypeStr: String = "",
|
||||
val poiTypeStrVr: String = "",
|
||||
val poiTypeSrcVr: Int = R.drawable.v2x_icon_live_logo,
|
||||
val content: String = "", val tts: String = ""
|
||||
) {
|
||||
|
||||
//交通检查
|
||||
TRAFFIC_CHECK(
|
||||
"10002", "交通检查", "前方交通检查",
|
||||
R.drawable.v2x_icon_jiaotongjiancha_vr, "前方交通检查", "交通检查"
|
||||
),
|
||||
|
||||
//封路
|
||||
ROAD_CLOSED(
|
||||
"10003", "封路", "前方封路", R.drawable.v2x_icon_fenglu_vr,
|
||||
"前方封路", "道路封路"
|
||||
),
|
||||
|
||||
//施工
|
||||
FOURS_ROAD_WORK(
|
||||
"10006", "注意施工占道", "注意施工占道", R.drawable.icon_warning_v2x_road_construction,
|
||||
"注意施工占道", "注意施工占道"
|
||||
),
|
||||
|
||||
//施工-AI云下发
|
||||
AI_ROAD_WORK(
|
||||
"100061", "道路施工", "前方施工", R.drawable.icon_warning_v2x_road_construction,
|
||||
"前方施工", "道路施工"
|
||||
),
|
||||
|
||||
//拥堵
|
||||
FOURS_BLOCK_UP(
|
||||
"10007", "道路拥堵", "前方拥堵", R.drawable.icon_warning_v2x_congestion,
|
||||
"前方道路拥堵", "道路拥堵"
|
||||
),
|
||||
|
||||
//积水
|
||||
FOURS_PONDING(
|
||||
"10008", "道路积水", "前方道路积水", R.drawable.v2x_icon_jishui_vr,
|
||||
"前方道路积水", "道路积水"
|
||||
),
|
||||
|
||||
//浓雾
|
||||
FOURS_FOG(
|
||||
"10010", "出现浓雾", "浓雾预警", R.drawable.v2x_icon_nongwu_vr,
|
||||
"前方出现浓雾", "出现浓雾"
|
||||
),
|
||||
|
||||
//结冰
|
||||
FOURS_ICE(
|
||||
"10011", "路面结冰", "路面结冰", R.drawable.v2x_icon_jiebing_vr,
|
||||
"前方路面结冰", "路面结冰"
|
||||
),
|
||||
|
||||
//事故
|
||||
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_LIVING("10015", "实时路况"),
|
||||
|
||||
//违章停车
|
||||
ILLEGAL_PARK_LIVING("10016"),
|
||||
|
||||
//路面湿滑
|
||||
ROAD_SLIPPERY("10021"),
|
||||
|
||||
//鬼探头类型
|
||||
GHOST_PROBE("10024", "前方盲区行人预警", "前方盲区行人预警", R.drawable.icon_warning_v2x_pedestrian_crossing,
|
||||
"前方盲区行人通行,请注意", "前方盲区即将有行人通过,请减速慢行"),
|
||||
|
||||
// 前方静止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"),
|
||||
|
||||
TYPE_USECASE_ID_EBW(
|
||||
MogoObuConstants.V2X_WARNING_TYPE.EBW.toString(),
|
||||
"紧急制动预警",
|
||||
poiTypeSrcVr = R.drawable.icon_warning_v2x_emergency_brake,
|
||||
content = "前车急刹车",
|
||||
tts = "前车急刹车"
|
||||
),
|
||||
TYPE_USECASE_ID_FCW(
|
||||
MogoObuConstants.V2X_WARNING_TYPE.FCW.toString(),
|
||||
"前向碰撞预警",
|
||||
poiTypeSrcVr = R.drawable.icon_warning_v2x_collision_warning,
|
||||
content = "前车碰撞预警",
|
||||
tts = "小心前车"
|
||||
),
|
||||
TYPE_USECASE_ID_ICW(
|
||||
MogoObuConstants.V2X_WARNING_TYPE.ICW.toString(),
|
||||
"交叉路口碰撞预警",
|
||||
poiTypeSrcVr = R.drawable.icon_warning_v2x_collision_warning,
|
||||
content = "交叉路口碰撞预警",
|
||||
tts = "注意交叉路口车辆"
|
||||
),
|
||||
TYPE_USECASE_ID_AVW(
|
||||
MogoObuConstants.V2X_WARNING_TYPE.AVW.toString(),
|
||||
"异常车辆提醒",
|
||||
poiTypeSrcVr = R.drawable.icon_warning_v2x_abnormal_vehicle,
|
||||
content = "%s车异常",
|
||||
tts = "小心%s异常车辆"
|
||||
),
|
||||
TYPE_USECASE_ID_BSW(
|
||||
MogoObuConstants.V2X_WARNING_TYPE.BSW.toString(),
|
||||
"盲区预警",
|
||||
poiTypeSrcVr = R.drawable.icon_warning_v2x_blind_area_collision,
|
||||
content = "%s后盲区预警",
|
||||
tts = "注意%s后车辆"
|
||||
),
|
||||
TYPE_USECASE_ID_LCW(
|
||||
MogoObuConstants.V2X_WARNING_TYPE.LCW.toString(),
|
||||
"变道预警",
|
||||
poiTypeSrcVr = R.drawable.icon_warning_v2x_reverse_overtaking,
|
||||
content = "%s向变道预警",
|
||||
tts = "注意%s后车辆"
|
||||
),//注意左后车辆/注意右后车辆
|
||||
|
||||
TYPE_USECASE_ID_EVW(
|
||||
MogoObuConstants.V2X_WARNING_TYPE.EVW.toString(),
|
||||
"紧急车辆提醒",
|
||||
poiTypeSrcVr = R.drawable.icon_warning_v2x_special_vehicle_access,
|
||||
content = "注意特种车辆通行",
|
||||
tts = "请避让特种车辆"
|
||||
),
|
||||
TYPE_USECASE_ID_CLW(
|
||||
MogoObuConstants.V2X_WARNING_TYPE.CLW.toString(),
|
||||
"车辆失控预警",
|
||||
poiTypeSrcVr = R.drawable.icon_warning_v2x_vehicle_control,
|
||||
content = "前%s失控预警",
|
||||
tts = "小心%s失控车辆"
|
||||
),
|
||||
TYPE_USECASE_ID_DNPW(
|
||||
MogoObuConstants.V2X_WARNING_TYPE.DNPW.toString(),
|
||||
"逆向超车预警",
|
||||
poiTypeSrcVr = R.drawable.icon_warning_v2x_reverse_overtaking,
|
||||
content = "逆向超车预警",
|
||||
tts = "注意对向来车"
|
||||
),
|
||||
TYPE_USECASE_ID_ROAD_GIVE_WAY(
|
||||
0x2C11.toString(),
|
||||
"减速慢行",
|
||||
poiTypeSrcVr = R.drawable.icon_warning_v2x_give_way,
|
||||
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_TURN_LEFT_SHARP(
|
||||
0x2C02.toString(),
|
||||
"前方左转急弯",
|
||||
poiTypeSrcVr = R.drawable.icon_warning_v2x_turn_left_sharp,
|
||||
content = "注意前方左转急弯",
|
||||
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(
|
||||
MogoObuConstants.V2X_WARNING_TYPE.LTA.toString(),
|
||||
"左转辅助",
|
||||
poiTypeSrcVr = R.drawable.icon_warning_v2x_collision_warning,
|
||||
content = "左转碰撞预警",
|
||||
tts = "注意路口对向来车"
|
||||
),
|
||||
|
||||
TYPE_USECASE_ID_IVS(
|
||||
MogoObuConstants.RSI_SCENE_TYPE.IVS.toString(),
|
||||
"车内标牌",
|
||||
poiTypeSrcVr = R.drawable.icon_warning_v2x_road_construction,
|
||||
content = "车内标牌",
|
||||
tts = ""
|
||||
),
|
||||
TYPE_USECASE_ID_TJW( //TODO
|
||||
MogoObuConstants.RSI_SCENE_TYPE.TJW.toString(),
|
||||
"前方拥堵提醒",
|
||||
poiTypeSrcVr = R.drawable.icon_warning_v2x_congestion,
|
||||
content = "前方%d米道路拥堵",
|
||||
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(
|
||||
MogoObuConstants.RSI_SCENE_TYPE.SLW.toString(),
|
||||
"道路危险情况预警",
|
||||
poiTypeSrcVr = R.drawable.icon_warning_v2x_road_dangerous,
|
||||
content = "道路危险情况预警",
|
||||
tts = "前方路况危险,小心行驶"
|
||||
),//(如果能给出具体的类别,则播报具体危险类别)
|
||||
|
||||
TYPE_USECASE_ID_IVP(
|
||||
0x2.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 KM/H"
|
||||
),
|
||||
|
||||
//6种智行杯的场景需添加
|
||||
TYPE_USECASE_ID_ROAD_VEHICLE_RETROGRADE(
|
||||
MogoObuConstants.RTE.RTI_TYPE_RETRIGRADE.toString(),
|
||||
"注意逆行车辆",
|
||||
poiTypeSrcVr = R.drawable.icon_warning_v2x_school,
|
||||
content = "注意逆行车辆",
|
||||
tts = "注意逆行车辆"
|
||||
),
|
||||
|
||||
TYPE_USECASE_ID_SLW(
|
||||
MogoObuConstants.RTE.RTI_TYPE_SPEEDING.toString(),
|
||||
"注意超速车辆",
|
||||
poiTypeSrcVr = R.drawable.icon_warning_v2x_over_speed,
|
||||
content = "注意超速车辆",
|
||||
tts = "注意超速车辆"
|
||||
),
|
||||
|
||||
TYPE_USECASE_ID_BREAKDOWN_WARNING(
|
||||
MogoObuConstants.RTE.RTI_TYPE_BREAKDOWN.toString(),
|
||||
"注意故障车辆",
|
||||
poiTypeSrcVr = R.drawable.icon_warning_v2x_collision_warning,
|
||||
content = "注意故障车辆",
|
||||
tts = "注意故障车辆"
|
||||
),
|
||||
|
||||
TYPE_USECASE_ID_ROAD_PARKING(
|
||||
MogoObuConstants.RTE.RTI_TYPE_PARKING_VIOLATION.toString(),
|
||||
"注意异常停车",
|
||||
poiTypeSrcVr = R.drawable.icon_warning_v2x_no_parking,
|
||||
content = "注意异常停车",
|
||||
tts = "注意异常停车"
|
||||
),
|
||||
|
||||
TYPE_USECASE_ID_ROAD_TRAMCAR(
|
||||
0x2C01.toString(),
|
||||
"前方有轨电车提醒",
|
||||
poiTypeSrcVr = R.drawable.icon_warning_v2x_tramcar,
|
||||
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_ERROR(
|
||||
MogoObuConstants.RSI_SCENE_TYPE.INVALID.toString(),
|
||||
"未知/错误/异常",
|
||||
poiTypeSrcVr = R.drawable.icon_warning_v2x_abnormal_vehicle,
|
||||
content = "",
|
||||
tts = ""
|
||||
),
|
||||
|
||||
TYPE_VIP_IDENTIFICATION("10022", "", "", R.drawable.icon_warning_v2x_vip_turn_light, "VIP车辆优先通行", "已为您变灯,请优先通行"),
|
||||
|
||||
TYPE_OPTIMAL_ROUTE_RECOMMEND("2000", "", "", R.drawable.icon_warning_v2x_optimal_route, "为您推荐最优路线", "已为您选择最优路线");
|
||||
|
||||
|
||||
companion object {
|
||||
@JvmStatic
|
||||
fun getPoiTypeStr(poiType: String): String {
|
||||
// 先获取网络配置的poi对应的名称
|
||||
CloudPoiManager.getInstance().getWrapperByPoiType(poiType)?.let {
|
||||
return it.title
|
||||
}
|
||||
// 如果获取不到,那么就用本地默认的
|
||||
return when (poiType) {
|
||||
TRAFFIC_CHECK.poiType -> TRAFFIC_CHECK.poiTypeStr
|
||||
ROAD_CLOSED.poiType -> ROAD_CLOSED.poiTypeStr
|
||||
FOURS_ROAD_WORK.poiType -> FOURS_ROAD_WORK.poiTypeStr
|
||||
AI_ROAD_WORK.poiType -> AI_ROAD_WORK.poiTypeStr
|
||||
FOURS_BLOCK_UP.poiType -> FOURS_BLOCK_UP.poiTypeStr
|
||||
FOURS_PONDING.poiType -> FOURS_PONDING.poiTypeStr
|
||||
FOURS_FOG.poiType -> FOURS_FOG.poiTypeStr
|
||||
FOURS_ICE.poiType -> FOURS_ICE.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_LIVING.poiType -> FOURS_LIVING.poiTypeStr
|
||||
GHOST_PROBE.poiType -> GHOST_PROBE.poiTypeStr
|
||||
else -> "其它道路事件"
|
||||
}
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
fun getPoiTypeStrVr(poiType: String): String {
|
||||
return when (poiType) {
|
||||
TRAFFIC_CHECK.poiType -> TRAFFIC_CHECK.poiTypeStrVr
|
||||
ROAD_CLOSED.poiType -> ROAD_CLOSED.poiTypeStrVr
|
||||
FOURS_ROAD_WORK.poiType -> FOURS_ROAD_WORK.poiTypeStrVr
|
||||
AI_ROAD_WORK.poiType -> AI_ROAD_WORK.poiTypeStrVr
|
||||
FOURS_BLOCK_UP.poiType -> FOURS_BLOCK_UP.poiTypeStrVr
|
||||
FOURS_PONDING.poiType -> FOURS_PONDING.poiTypeStrVr
|
||||
FOURS_FOG.poiType -> FOURS_FOG.poiTypeStrVr
|
||||
FOURS_ICE.poiType -> FOURS_ICE.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_LIVING.poiType -> FOURS_LIVING.poiTypeStrVr
|
||||
GHOST_PROBE.poiType -> GHOST_PROBE.poiTypeStrVr
|
||||
else -> "其它道路事件"
|
||||
}
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
fun getPoiTypeSrcVr(poiType: String): Int {
|
||||
return when (poiType) {
|
||||
TRAFFIC_CHECK.poiType -> TRAFFIC_CHECK.poiTypeSrcVr
|
||||
ROAD_CLOSED.poiType -> ROAD_CLOSED.poiTypeSrcVr
|
||||
FOURS_ROAD_WORK.poiType -> FOURS_ROAD_WORK.poiTypeSrcVr
|
||||
AI_ROAD_WORK.poiType -> AI_ROAD_WORK.poiTypeSrcVr
|
||||
FOURS_BLOCK_UP.poiType -> FOURS_BLOCK_UP.poiTypeSrcVr
|
||||
FOURS_PONDING.poiType -> FOURS_PONDING.poiTypeSrcVr
|
||||
FOURS_FOG.poiType -> FOURS_FOG.poiTypeSrcVr
|
||||
FOURS_ICE.poiType -> FOURS_ICE.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_LIVING.poiType -> FOURS_LIVING.poiTypeSrcVr
|
||||
else -> R.drawable.v2x_icon_live_logo
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取道路事件的背景色
|
||||
*/
|
||||
@JvmStatic
|
||||
fun getPoiTypeBg(poiType: String, isVrMode: Boolean): Int {
|
||||
return when (poiType) {
|
||||
FOURS_BLOCK_UP.poiType, FOURS_LIVING.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,AI_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_BLOCK_UP.poiType, FOURS_LIVING.poiType ->
|
||||
R.drawable.bg_v2x_event_type_orange
|
||||
TRAFFIC_CHECK.poiType, ROAD_CLOSED.poiType,
|
||||
FOURS_ROAD_WORK.poiType,AI_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,AI_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, GHOST_PROBE.poiType, AI_ROAD_WORK.poiType -> true
|
||||
else -> false
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否需要UGC预警
|
||||
*/
|
||||
@JvmStatic
|
||||
fun isNeedRoadEventUgc(poiType: String?): Boolean {
|
||||
return when (poiType) {
|
||||
ROAD_CLOSED.poiType, FOURS_ROAD_WORK.poiType,AI_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, GHOST_PROBE.poiType -> true
|
||||
else -> false
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@JvmStatic
|
||||
fun getTts(poiType: String?): String {
|
||||
return when (poiType) {
|
||||
TRAFFIC_CHECK.poiType -> TRAFFIC_CHECK.tts
|
||||
ROAD_CLOSED.poiType -> ROAD_CLOSED.tts
|
||||
FOURS_ROAD_WORK.poiType -> FOURS_ROAD_WORK.tts
|
||||
AI_ROAD_WORK.poiType -> AI_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) {
|
||||
TRAFFIC_CHECK.poiType -> "交通检查"
|
||||
ROAD_CLOSED.poiType -> "封路"
|
||||
FOURS_ROAD_WORK.poiType -> "施工"
|
||||
AI_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) {
|
||||
TRAFFIC_CHECK.poiType -> TRAFFIC_CHECK.content
|
||||
ROAD_CLOSED.poiType -> ROAD_CLOSED.content
|
||||
FOURS_ROAD_WORK.poiType -> FOURS_ROAD_WORK.content
|
||||
AI_ROAD_WORK.poiType -> AI_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
|
||||
GHOST_PROBE.poiType -> GHOST_PROBE.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
|
||||
AI_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
|
||||
AI_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 -> "施工"
|
||||
AI_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
|
||||
AI_ROAD_WORK.poiType -> R.raw.v2x_daolushigong
|
||||
FOURS_ICE.poiType -> R.raw.v2x_daolujiebing
|
||||
FOURS_PONDING.poiType -> R.raw.v2x_daolujishui
|
||||
GHOST_PROBE.poiType -> R.raw.v2x_guzhangqiuzhu
|
||||
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 -> "施工"
|
||||
AI_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
|
||||
}
|
||||
//AI施工
|
||||
AI_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
|
||||
}
|
||||
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_VIP_IDENTIFICATION.poiType -> TYPE_VIP_IDENTIFICATION.poiTypeSrcVr
|
||||
TYPE_ERROR.poiType -> TYPE_ERROR.poiTypeSrcVr
|
||||
TYPE_OPTIMAL_ROUTE_RECOMMEND.poiType -> TYPE_OPTIMAL_ROUTE_RECOMMEND.poiTypeSrcVr
|
||||
GHOST_PROBE.poiType -> GHOST_PROBE.poiTypeSrcVr
|
||||
AI_ROAD_WORK.poiType -> AI_ROAD_WORK.poiTypeSrcVr
|
||||
else -> TYPE_ERROR.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_VIP_IDENTIFICATION.poiType -> TYPE_VIP_IDENTIFICATION.content
|
||||
FOURS_ROAD_WORK.poiType -> FOURS_ROAD_WORK.content
|
||||
AI_ROAD_WORK.poiType -> AI_ROAD_WORK.content
|
||||
TYPE_ERROR.poiType -> TYPE_ERROR.content
|
||||
TYPE_OPTIMAL_ROUTE_RECOMMEND.poiType -> TYPE_OPTIMAL_ROUTE_RECOMMEND.content
|
||||
GHOST_PROBE.poiType -> GHOST_PROBE.content
|
||||
else -> TYPE_ERROR.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 //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
|
||||
FOURS_ROAD_WORK.poiType -> FOURS_ROAD_WORK.tts
|
||||
AI_ROAD_WORK.poiType -> AI_ROAD_WORK.tts
|
||||
TYPE_ERROR.poiType -> TYPE_ERROR.tts
|
||||
TYPE_OPTIMAL_ROUTE_RECOMMEND.poiType -> TYPE_OPTIMAL_ROUTE_RECOMMEND.tts
|
||||
GHOST_PROBE.poiType -> GHOST_PROBE.tts
|
||||
else -> TYPE_ERROR.tts
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,263 @@
|
||||
package com.mogo.module.common.enums
|
||||
|
||||
import com.mogo.module.common.R
|
||||
import com.mogo.module.common.utils.CloudPoiManager
|
||||
import com.mogo.support.obu.constants.MogoObuConstants
|
||||
|
||||
/**
|
||||
* OBU、V2i事件类型枚举类
|
||||
*/
|
||||
enum class V2iEventTypeEnum(
|
||||
val poiType: String, val poiTypeStr: String = "",
|
||||
val poiTypeStrVr: String = "",
|
||||
val poiTypeSrcVr: Int = R.drawable.v2x_icon_live_logo,
|
||||
val content: String = "", val tts: String = ""
|
||||
) {
|
||||
|
||||
//施工
|
||||
FOURS_ROAD_WORK(
|
||||
"10006", "注意施工占道", "注意施工占道", R.drawable.icon_warning_v2x_road_construction,
|
||||
"注意施工占道", "注意施工占道"
|
||||
),
|
||||
|
||||
//积水
|
||||
FOURS_PONDING(
|
||||
"10008", "道路积水", "前方道路积水", R.drawable.v2x_icon_jishui_vr,
|
||||
"前方道路积水", "道路积水"
|
||||
),
|
||||
|
||||
TYPE_USECASE_ID_IVS(
|
||||
MogoObuConstants.RSI_SCENE_TYPE.IVS.toString(),
|
||||
"车内标牌",
|
||||
poiTypeSrcVr = R.drawable.icon_warning_v2x_road_construction,
|
||||
content = "车内标牌",
|
||||
tts = ""
|
||||
),
|
||||
TYPE_USECASE_ID_TJW(
|
||||
MogoObuConstants.RSI_SCENE_TYPE.TJW.toString(),
|
||||
"前方拥堵提醒",
|
||||
poiTypeSrcVr = R.drawable.icon_warning_v2x_congestion,
|
||||
content = "前方%d米道路拥堵",
|
||||
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(
|
||||
MogoObuConstants.RSI_SCENE_TYPE.SLW.toString(),
|
||||
"道路危险情况预警",
|
||||
poiTypeSrcVr = R.drawable.icon_warning_v2x_road_dangerous,
|
||||
content = "道路危险情况预警",
|
||||
tts = "前方路况危险,小心行驶"
|
||||
),//(如果能给出具体的类别,则播报具体危险类别)
|
||||
|
||||
TYPE_USECASE_ID_IVP(
|
||||
0x2.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 KM/H"
|
||||
),
|
||||
|
||||
//6种智行杯的场景需添加
|
||||
TYPE_USECASE_ID_ROAD_VEHICLE_RETROGRADE(
|
||||
MogoObuConstants.RTE.RTI_TYPE_RETRIGRADE.toString(),
|
||||
"注意逆行车辆",
|
||||
poiTypeSrcVr = R.drawable.icon_warning_v2x_school,
|
||||
content = "注意逆行车辆",
|
||||
tts = "注意逆行车辆"
|
||||
),
|
||||
|
||||
TYPE_USECASE_ID_SLW(
|
||||
MogoObuConstants.RTE.RTI_TYPE_SPEEDING.toString(),
|
||||
"注意超速车辆",
|
||||
poiTypeSrcVr = R.drawable.icon_warning_v2x_over_speed,
|
||||
content = "注意超速车辆",
|
||||
tts = "注意超速车辆"
|
||||
),
|
||||
|
||||
TYPE_USECASE_ID_BREAKDOWN_WARNING(
|
||||
MogoObuConstants.RTE.RTI_TYPE_BREAKDOWN.toString(),
|
||||
"注意故障车辆",
|
||||
poiTypeSrcVr = R.drawable.icon_warning_v2x_collision_warning,
|
||||
content = "注意故障车辆",
|
||||
tts = "注意故障车辆"
|
||||
),
|
||||
|
||||
TYPE_USECASE_ID_ROAD_PARKING(
|
||||
MogoObuConstants.RTE.RTI_TYPE_PARKING_VIOLATION.toString(),
|
||||
"注意异常停车",
|
||||
poiTypeSrcVr = R.drawable.icon_warning_v2x_no_parking,
|
||||
content = "注意异常停车",
|
||||
tts = "注意异常停车"
|
||||
),
|
||||
|
||||
TYPE_USECASE_ID_ROAD_TRAMCAR(
|
||||
0x2C01.toString(),
|
||||
"前方有轨电车提醒",
|
||||
poiTypeSrcVr = R.drawable.icon_warning_v2x_tramcar,
|
||||
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_ERROR(
|
||||
MogoObuConstants.RSI_SCENE_TYPE.INVALID.toString(),
|
||||
"未知/错误/异常",
|
||||
poiTypeSrcVr = R.drawable.icon_warning_v2x_abnormal_vehicle,
|
||||
content = "",
|
||||
tts = ""
|
||||
),
|
||||
|
||||
TYPE_VIP_IDENTIFICATION("10022", "", "", R.drawable.icon_warning_v2x_vip_turn_light, "VIP车辆优先通行", "已为您变灯,请优先通行"),
|
||||
TYPE_OPTIMAL_ROUTE_RECOMMEND("2000", "", "", R.drawable.icon_warning_v2x_optimal_route, "为您推荐最优路线", "已为您选择最优路线");
|
||||
|
||||
|
||||
companion object {
|
||||
|
||||
//===================告警类事件===================
|
||||
|
||||
@JvmStatic
|
||||
fun getTts(poiType: String?): String {
|
||||
return when (poiType) {
|
||||
FOURS_ROAD_WORK.poiType -> FOURS_ROAD_WORK.tts
|
||||
else -> "道路事件"
|
||||
}
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
fun getWarningIcon(poiType: String?): Int {
|
||||
return when (poiType) {
|
||||
TYPE_USECASE_ID_SLW.poiType -> TYPE_USECASE_ID_SLW.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_ROAD_TRAMCAR.poiType -> TYPE_USECASE_ID_ROAD_TRAMCAR.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_VIP_IDENTIFICATION.poiType -> TYPE_VIP_IDENTIFICATION.poiTypeSrcVr
|
||||
TYPE_ERROR.poiType -> TYPE_ERROR.poiTypeSrcVr
|
||||
TYPE_OPTIMAL_ROUTE_RECOMMEND.poiType -> TYPE_OPTIMAL_ROUTE_RECOMMEND.poiTypeSrcVr
|
||||
else -> TYPE_ERROR.poiTypeSrcVr
|
||||
}
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
fun getWarningContent(poiType: String?): String {
|
||||
return when (poiType) {
|
||||
TYPE_USECASE_ID_SLW.poiType -> TYPE_USECASE_ID_SLW.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_ROAD_TRAMCAR.poiType -> TYPE_USECASE_ID_ROAD_TRAMCAR.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_VIP_IDENTIFICATION.poiType -> TYPE_VIP_IDENTIFICATION.content
|
||||
TYPE_ERROR.poiType -> TYPE_ERROR.content
|
||||
FOURS_ROAD_WORK.poiType -> FOURS_ROAD_WORK.content
|
||||
TYPE_OPTIMAL_ROUTE_RECOMMEND.poiType -> TYPE_OPTIMAL_ROUTE_RECOMMEND.content
|
||||
else -> TYPE_ERROR.content
|
||||
}
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
fun getWarningTts(poiType: String?): String {
|
||||
return when (poiType) {
|
||||
TYPE_USECASE_ID_SLW.poiType -> TYPE_USECASE_ID_SLW.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_ROAD_TRAMCAR.poiType -> TYPE_USECASE_ID_ROAD_TRAMCAR.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_VIP_IDENTIFICATION.poiType -> TYPE_VIP_IDENTIFICATION.tts
|
||||
TYPE_ERROR.poiType -> TYPE_ERROR.tts
|
||||
FOURS_ROAD_WORK.poiType -> FOURS_ROAD_WORK.tts
|
||||
TYPE_OPTIMAL_ROUTE_RECOMMEND.poiType -> TYPE_OPTIMAL_ROUTE_RECOMMEND.tts
|
||||
else -> TYPE_ERROR.tts
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -105,8 +105,8 @@ public class ApmCrashReportProvider implements ITestCrashReportProvider {
|
||||
HashMap<String, String> dimension = new HashMap<>();
|
||||
//维度值
|
||||
dimension.put("Devices_SN_DeviceId", sn + "__" + DeviceIdUtils.getDeviceId(context));
|
||||
dimension.put("Devices_SN_WidevineID_MD5", sn + "__" + DeviceIdUtils.getWidevineIDWithMd5(context));
|
||||
dimension.put("Devices_SN_WidevineID", sn + "__" + DeviceIdUtils.getWidevineID(context));
|
||||
// dimension.put("Devices_SN_WidevineID_MD5", sn + "__" + DeviceIdUtils.getWidevineIDWithMd5(context));
|
||||
// dimension.put("Devices_SN_WidevineID", sn + "__" + DeviceIdUtils.getWidevineID(context));
|
||||
dimension.put(MAP_SDK_VERSION, mapSDKVersion);
|
||||
dimension.put("CITYCODE", mCityCode);
|
||||
dimension.put("LATITUDE", mLat);
|
||||
|
||||
Reference in New Issue
Block a user