Merge branch 'dev_robotaxi-d-app-module_2130_221116_2.13.0' of gitlab.zhidaoauto.com:zhjt/AndroidApp/MoGoEagleEye into dev_robotaxi-d-app-module_2130_221116_2.13.0

This commit is contained in:
xinfengkun
2022-11-29 16:27:17 +08:00
69 changed files with 1998 additions and 1234 deletions

View File

@@ -70,7 +70,7 @@ import static com.mogo.och.bus.passenger.constant.BusPassengerConst.STATION_STAT
public class BusPassengerModel {
private static final String TAG = BusPassengerModel.class.getSimpleName();
private List<LatLng> mRoutePoints = new ArrayList<>();
private List<Location> mRoutePoints = new ArrayList<>();
private static final class SingletonHolder {
private static final BusPassengerModel INSTANCE = new BusPassengerModel();
@@ -88,13 +88,15 @@ public class BusPassengerModel {
private IBusPassegerDriverStatusCallback mDriverStatusCallback; //出车收车状态
private IBusPassengerRouteLineInfoCallback mRouteLineInfoCallback; // bus路线信息更新
private double mLongitude, mLatitude;
// private double mLongitude, mLatitude;
private Location mLocation = null;
private BusPassengerRoutesResult routesResult = null;
List<BusPassengerStation> mStations = new ArrayList<>();
private int mNextStationIndex = 0;// 要到达站的index
private List<LatLng> mTwoStationsRouts = new ArrayList<>();
private List<Location> mTwoStationsRouts = new ArrayList<>();
private int mPreRouteIndex = 0;
private static final int MSG_QUERY_BUS_P_STATION = 1001;
private final Handler handler = new Handler(new Handler.Callback() {
@@ -307,8 +309,9 @@ public class BusPassengerModel {
public void onCarLocationChanged2( Location location ) {
//位置变化时通过围栏判断是否到达x点
// TODO: 2022/3/31
mLongitude = location.getLongitude();
mLatitude = location.getLatitude();
// mLongitude = location.getLongitude();
// mLatitude = location.getLatitude();
mLocation = location;
for (IBusPassengerControllerStatusCallback callback :mControllerStatusCallbackMap.values()){
callback.onCarLocationChanged(location);
}
@@ -403,8 +406,8 @@ public class BusPassengerModel {
public void updateRoutePoints(List<MessagePad.Location> routePoints){
mRoutePoints.clear();
List<LatLng> latLngModels = CoordinateCalculateRouteUtil
.coordinateConverterWgsToGcjListCommon(mContext,routePoints);
List<Location> latLngModels = CoordinateCalculateRouteUtil
.coordinateConverterWgsToGcjLocations(mContext,routePoints);
mRoutePoints.addAll(latLngModels);
calculateTwoStationsRoute();
}
@@ -419,10 +422,12 @@ public class BusPassengerModel {
BusPassengerStation stationNext = mStations.get(mNextStationIndex);
BusPassengerStation stationCur = mStations.get(mNextStationIndex - 1);
//当前站在轨迹中对应的点
int currentRouteIndex = CoordinateCalculateRouteUtil.getArrivedPointIndex(mRoutePoints
int currentRouteIndex = CoordinateCalculateRouteUtil.getArrivedPointIndexNew(0
,mRoutePoints
,stationCur.getGcjLon(),stationCur.getGcjLat());
//要前往的站在轨迹中对应的点
int nextRouteIndex = CoordinateCalculateRouteUtil.getArrivedPointIndex(mRoutePoints
int nextRouteIndex = CoordinateCalculateRouteUtil.getArrivedPointIndexNew(currentRouteIndex
,mRoutePoints
,stationNext.getGcjLon(),stationNext.getGcjLat());
if (currentRouteIndex < nextRouteIndex){ //如果找到的next在起点的轨迹前面直接舍弃这个轨迹不显示
mTwoStationsRouts.addAll(mRoutePoints.subList(currentRouteIndex,nextRouteIndex));
@@ -448,22 +453,28 @@ public class BusPassengerModel {
if (mTwoStationsRouts.size() == 0){
calculateTwoStationsRoute();
}
if (mTwoStationsRouts.size() > 0){
List<LatLng> lastPoints = CoordinateCalculateRouteUtil
.getRemainPointListByCompare(mTwoStationsRouts,mLongitude,mLatitude);
float lastSumLength = 0;
if (lastPoints.size() == 1){ //只是最后一个点,计算当前位置和最后一个点的距离
lastSumLength = CoordinateUtils.calculateLineDistance(
lastPoints.get(0).longitude, lastPoints.get(0).latitude,
mLongitude, mLatitude);
}else {
lastSumLength = CoordinateCalculateRouteUtil.calculateRouteSumLength(lastPoints);
if (mTwoStationsRouts.size() > 0 && mLocation != null){
Map<Integer,List<Location>> lastPointsMap = CoordinateCalculateRouteUtil
.getRemainPointListByCompareNew(mPreRouteIndex,mTwoStationsRouts,mLocation);
for (int index: lastPointsMap.keySet()) {
mPreRouteIndex = index;
break;
}
double lastTime = lastSumLength / BusPassengerConst.BUS_AVERAGE_SPEED * 3.6 ; //秒
CallerLogger.INSTANCE.d(M_BUS_P + TAG, "lastSumLength = " + lastSumLength);
if (mAutopilotPlanningCallback != null){
mAutopilotPlanningCallback.routePlanningToNextStationChanged((long)lastSumLength,(long) lastTime);
for (List<Location> lastPoints: lastPointsMap.values()){
float lastSumLength = 0;
if (lastPoints.size() == 1){ //只是最后一个点,计算当前位置和最后一个点的距离
lastSumLength = CoordinateUtils.calculateLineDistance(
lastPoints.get(0).getLongitude(), lastPoints.get(0).getLatitude(),
mLocation.getLongitude(), mLocation.getLatitude());
}else {
lastSumLength = CoordinateCalculateRouteUtil.calculateRouteSumLength(lastPoints);
}
double lastTime = lastSumLength / BusPassengerConst.BUS_AVERAGE_SPEED * 3.6 ; //秒
CallerLogger.INSTANCE.d(M_BUS_P + TAG, "lastSumLength = " + lastSumLength);
if (mAutopilotPlanningCallback != null){
mAutopilotPlanningCallback.routePlanningToNextStationChanged((long)lastSumLength,(long) lastTime);
}
}
}
}
@@ -490,13 +501,18 @@ public class BusPassengerModel {
}
public void loopRouteAndWipe() {
if (mRoutePoints != null && mRoutePoints.size() > 0){
if (mRoutePoints != null && mRoutePoints.size() > 0 && mLocation != null){
int haveArrivedIndex = CoordinateCalculateRouteUtil
.getArrivedPointIndex(mRoutePoints,mLongitude,mLatitude);
.getArrivedPointIndexNew(mPreRouteIndex,
mRoutePoints,
mLocation.getLongitude(),
mLocation.getLatitude());
CallerLogger.INSTANCE.d(M_BUS_P + TAG, "thread = "+ Thread.currentThread().getName()+" haveArrivedIndex== " + haveArrivedIndex);
if (mAutopilotPlanningCallback != null){
mAutopilotPlanningCallback.routeResult(mRoutePoints,haveArrivedIndex);
List<LatLng> routePoints = CoordinateCalculateRouteUtil
.coordinateConverterLocationToLatLng(mContext,mRoutePoints);
mAutopilotPlanningCallback.routeResult(routePoints,haveArrivedIndex);
}
}
}
@@ -505,8 +521,10 @@ public class BusPassengerModel {
* 设置小地图路径的起终点marker
*/
public void setRouteLineMarker(){
if (mAutopilotPlanningCallback != null){
mAutopilotPlanningCallback.setLineMarker(mRoutePoints);
if (mAutopilotPlanningCallback != null && mRoutePoints != null){
List<LatLng> routePoints = CoordinateCalculateRouteUtil
.coordinateConverterLocationToLatLng(mContext,mRoutePoints);
mAutopilotPlanningCallback.setLineMarker(routePoints);
}
}

View File

@@ -197,10 +197,11 @@ public class BusPassengerMapDirectionView
mCarMarker.setToTop();
}
//圈定地图显示范围
LatLngBounds.Builder boundsBuilder = new LatLngBounds.Builder();
if (mLinePointsLatLng.size() > 0){
//圈定地图显示范围
//存放经纬度
LatLngBounds.Builder boundsBuilder = new LatLngBounds.Builder();
for (int i = 0; i < mLinePointsLatLng.size(); i++) {
boundsBuilder.include(mLinePointsLatLng.get(i));
}
@@ -208,13 +209,15 @@ public class BusPassengerMapDirectionView
//第二个参数为四周留空宽度
mAMap.moveCamera(CameraUpdateFactory.newLatLngBoundsRect(boundsBuilder.build(),100,100,100,100));
}
// else {
// //设置希望展示的地图缩放级别
} else {
boundsBuilder.include(currentLatLng);
//第二个参数为四周留空宽度
mAMap.moveCamera(CameraUpdateFactory.newLatLngBoundsRect(boundsBuilder.build(),100,100,100,100));
//设置希望展示的地图缩放级别
// CameraPosition cameraPosition = new CameraPosition.Builder()
// .target(mCarMarker.getPosition()).tilt(0).bearing(location.getBearing()).zoom(zoomLevel).build();
// mAMap.moveCamera(CameraUpdateFactory.newCameraPosition(cameraPosition));
// }
}
}

View File

@@ -32,8 +32,10 @@ import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager;
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager;
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotPlanningListenerManager;
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
import com.mogo.eagle.core.utilcode.mogo.toast.TipToast;
import com.mogo.eagle.core.utilcode.util.NetworkUtils;
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.bus.R;
@@ -117,9 +119,7 @@ public class BusOrderModel {
private volatile int firstStartAutopilot = 0;
private LoginService loginService;
private long prePassengerWriteOffTime = 0; //记录最后查询到乘客核销的时间
private final Handler handler = new Handler(new Handler.Callback() {
@Override
public boolean handleMessage(Message msg) {
@@ -443,6 +443,7 @@ public class BusOrderModel {
clearAutopilotControlParameters();
closeBeautificationMode();
clearStartAutopilotTag();
removeTipRunnables();
return;
}
CallerLogger.INSTANCE.d(M_BUS + TAG, "获取到小巴路线数据: " + data);
@@ -797,6 +798,11 @@ public class BusOrderModel {
BusSendTripInfoManager.INSTANCE.sendBusTripInfo(BusSendTripInfoManager.START_TRIP
, busRoutesResult.getName(), "", "", false);
}
//任务选择后首发前给司机提示任务
if (busRoutesResult != null){
beforeTaskTips();
}
// startOrStopQueryPassengerWriteOff(true);
}
@@ -836,6 +842,70 @@ public class BusOrderModel {
BusTrajectoryManager.getInstance().syncTrajectoryInfo();
}
private void beforeTaskTips() {
if (busRoutesResult == null) return;
removeTipRunnables();
long taskTime = busRoutesResult.getTaskTime();
long tip3Time = taskTime- 3*60*1000 - DateTimeUtil.getCurrentTimeStamp(); // 首站离开前3分钟提示
long tip1Time = taskTime-60*1000 - DateTimeUtil.getCurrentTimeStamp(); // 首站离开前1分钟提示
if (tip3Time > 0){
UiThreadHandler.postDelayed(tip3Runnable,tip3Time);
}
if (tip1Time > 0){
UiThreadHandler.postDelayed(tip1Runnable,tip1Time);
}
}
Runnable tip3Runnable = new Runnable() {
@Override
public void run() {
if (backgroundCurrentStationIndex == 0 && stationList.get(0).getDrivingStatus() == STATION_STATUS_STOPPED
&& !stationList.get(0).isLeaving()){
tipStartTask("3");
}else {
removeTipRunnables();
}
}
};
private void tipStartTask(String s) {
String tips = String.format(mContext
.getString(R.string.bus_before_tips_s), s);
//展示在运营消息
OCHSocketMessageManager.INSTANCE.pushAppOperationalMsgBox(
DateTimeUtil.getCurrentTimeStamp(),
tips);
//语音提示
VoiceNotice.showNotice(tips);
}
Runnable tip1Runnable = new Runnable() {
@Override
public void run() {
if (backgroundCurrentStationIndex == 0 && stationList != null &&
stationList.get(0).getDrivingStatus() == STATION_STATUS_STOPPED
&& !stationList.get(0).isLeaving()){
tipStartTask("1");
}else {
removeTipRunnables();
}
}
};
public void removeTipRunnables(){
if (tip3Runnable != null){
UiThreadHandler.removeCallbacks(tip3Runnable);
}
if (tip1Runnable != null){
UiThreadHandler.removeCallbacks(tip1Runnable);
}
}
private void clearStartAutopilotTag() {
firstStartAutopilot = 0;
}

View File

@@ -47,4 +47,6 @@
<string name="bus_end_task_tip">感谢您体验\'蘑菇车联\'自动驾驶小巴车,我们下次再见。</string>
<!-- endregion -->
<string name="bus_before_tips_s">距离发车时间还有%1$s分钟</string>
</resources>

View File

@@ -21,20 +21,36 @@ import mogo.telematics.pad.MessagePad;
*/
public class CoordinateCalculateRouteUtil {
public static float calculateRouteSumLength(List<LatLng> points){
public static <T> float calculateRouteSumLength(List<T> points){
if (null == points || points.size() == 0) return 0;
float sumLength = 0;
//计算全路径总距离
for (int i = 0;i + 1< points.size();i++){
double preLat = points.get(i).latitude;
double preLon = points.get(i).longitude;
double laLat = points.get(i+1).latitude;
double laLon = points.get(i+1).longitude;
if (points.get(1) instanceof Location){
//计算全路径总距离
for (int i = 0;i + 1< points.size();i++){
Location locationPre = (Location) points.get(i);
Location location = (Location) points.get(i+1);
double preLat = locationPre.getLatitude();
double preLon = locationPre.getLongitude();
double laLat = location.getLatitude();
double laLon = location.getLongitude();
float length = CoordinateUtils.calculateLineDistance(laLon,laLat,preLon,preLat);
sumLength += length;
float length = CoordinateUtils.calculateLineDistance(laLon,laLat,preLon,preLat);
sumLength += length;
}
}else if (points.get(1) instanceof LatLng){
for (int i = 0;i + 1< points.size();i++){
LatLng locationPre = (LatLng) points.get(i);
LatLng location = (LatLng) points.get(i+1);
double preLat = locationPre.latitude;
double preLon = locationPre.longitude;
double laLat = location.latitude;
double laLon = location.longitude;
float length = CoordinateUtils.calculateLineDistance(laLon,laLat,preLon,preLat);
sumLength += length;
}
}
return sumLength;
}
@@ -65,75 +81,6 @@ public class CoordinateCalculateRouteUtil {
return latLng;
}
/**
* 根据实时定位的坐标确定出已行驶到那个坐标点 todo 有问题 暂不使用
* @param mRoutePoints
* @param realLon
* @param realLat
* @return 返回剩余路径集合
*/
@Deprecated
public static List<LatLng> getCurrentPoinByCompare(List<LatLng> mRoutePoints,double realLon,double realLat) {
// 疑似坐标 先以坐标中间1/2为第一个比对点
int currentIndex = Math.round(mRoutePoints.size()/2);
LatLng currentLatLng = mRoutePoints.get(currentIndex);
//差值初始化
float baseDiffDis = CoordinateUtils.calculateLineDistance(realLon,realLat
,currentLatLng.longitude,currentLatLng.latitude);// lon,lat, prelon, prelat
List<LatLng> latePoints = new ArrayList<>();
//与选中点左右比较
if (currentIndex -1 >= 0 && currentIndex+1<= mRoutePoints.size()-1){
LatLng leftCurrentLatLng = mRoutePoints.get(currentIndex -1);
LatLng rightCurentLatLng = mRoutePoints.get(currentIndex + 1);
float leftDiffDis = CoordinateUtils.calculateLineDistance(realLon,realLat
,leftCurrentLatLng.longitude,leftCurrentLatLng.latitude);
float rightDiffDis = CoordinateUtils.calculateLineDistance(realLon,realLat,rightCurentLatLng.longitude,rightCurentLatLng.latitude);
if (rightDiffDis < leftDiffDis){ //靠近了右半边
baseDiffDis = rightDiffDis;
for (int i = currentIndex +1; i+1 <mRoutePoints.size() ;i++){
float diff = CoordinateUtils.calculateLineDistance(realLon,realLat
,mRoutePoints.get(i).longitude,mRoutePoints.get(i).latitude);
// Logger.d(M_TAXI + "Compare右半边集合", "点:"+i+"------------baseDiffDis = "+baseDiffDis+"---diff="+diff);
if (baseDiffDis >= diff){
baseDiffDis = diff;
currentIndex = i;
if (i == mRoutePoints.size()-1){
latePoints.addAll(mRoutePoints);
}
}else {
latePoints.addAll(mRoutePoints.subList(currentIndex,mRoutePoints.size()-1));
return latePoints;
}
}
}else if (rightDiffDis > leftDiffDis){ //靠近左半边
baseDiffDis = leftDiffDis;
for (int j = currentIndex-1; j -1 >=0 ;j++){
float diff = CoordinateUtils.calculateLineDistance(realLon,realLat,mRoutePoints.get(j).longitude,mRoutePoints.get(j).latitude);
// Logger.d(M_TAXI + "Compare左半边集合", "点:"+j+"------------baseDiffDis = "+baseDiffDis+"---diff="+diff);
if (baseDiffDis >= diff){
baseDiffDis = diff;
currentIndex = j;
if (j == 0){
latePoints.addAll(mRoutePoints);
}
}else {
latePoints.addAll(mRoutePoints.subList(currentIndex,mRoutePoints.size()-1));
return latePoints;
}
}
}else {
// Logger.d(M_TAXI + "正好相等", "点:"+currentIndex+"------------baseDiffDis = "+baseDiffDis+"---diff="+leftDiffDis);
latePoints.addAll(mRoutePoints.subList(currentIndex,currentIndex));
return latePoints;
}
}
return latePoints;
}
/**
* 简单粗暴 直接比较 todo 需要优化
* @param mRoutePoints
@@ -239,11 +186,40 @@ public class CoordinateCalculateRouteUtil {
return list;
}
public static Map<Integer,List<LatLng>> getRemainPointListByCompareNew(int preIndex,
public static List<Location> coordinateConverterLatlngToLocation(List<LatLng> models) {
//转成MogoLatLng集合
List<Location> list = new ArrayList<>();
for (LatLng m : models) {
Location location = new Location("gcj_provider");
location.setLatitude(m.latitude);
location.setLongitude(m.longitude);
list.add(location);
}
return list;
}
public static List<LatLng> coordinateConverterLocationToLatLng(Context mContext, List<Location> models) {
//转成MogoLatLng集合
List<LatLng> list = new ArrayList<>();
for (Location m : models) {
LatLng mogoLatLng = coordinateConverterWgsToGcj(mContext, m.getLongitude(),m.getLatitude());
list.add(mogoLatLng);
}
return list;
}
/**
* 根据前一个index经纬度航向角确认剩余轨迹
* @param preIndex
* @param mRoutePoints
* @param realLocation
* @return
*/
public static Map<Integer,List<Location>> getRemainPointListByCompareNew(int preIndex,
List<Location> mRoutePoints,
Location realLocation) {
Map<Integer,List<LatLng>> routePonits = new HashMap<>();
List<LatLng> latePoints = new ArrayList<>(); // 剩余轨迹集合
Map<Integer,List<Location>> routePonits = new HashMap<>();
List<Location> latePoints = new ArrayList<>(); // 剩余轨迹集合
int currentIndex = 0; //记录疑似点
if (mRoutePoints.size() > preIndex){
//基础点
@@ -269,13 +245,13 @@ public class CoordinateCalculateRouteUtil {
Logger.d( "calculateRouteSumLength", "点:"+currentIndex+"-------是最近的点------ ");
if (currentIndex == mRoutePoints.size()-1){
Location location = mRoutePoints.get(currentIndex);
LatLng latLng = new LatLng(location.getLatitude(), location.getLongitude());
latePoints.add(latLng);
// LatLng latLng = new LatLng(location.getLatitude(), location.getLongitude());
latePoints.add(location);
}else {
List<Location> locations = mRoutePoints.subList(currentIndex,mRoutePoints.size()-1);
for (Location location: locations) {
LatLng latLng = new LatLng(location.getLatitude(), location.getLongitude());
latePoints.add(latLng);
// LatLng latLng = new LatLng(location.getLatitude(), location.getLongitude());
latePoints.add(location);
}
}
routePonits.put(currentIndex,latePoints);
@@ -284,27 +260,27 @@ public class CoordinateCalculateRouteUtil {
return routePonits;
}
public static int getArrivedPointIndexNew(List<Location> mRoutePoints,
Location realLocation) {
int currentIndex = 0; //记录疑似点 //基础点
public static int getArrivedPointIndexNew(int preIndex, List<Location> mRoutePoints,
double realLon,double realLat) {
int currentIndex = preIndex; //记录疑似点 //基础点
Location baseLatLng = mRoutePoints.get(0);
float baseDiffDis = CoordinateUtils.calculateLineDistance(realLocation.getLongitude(),
realLocation.getLatitude()
float baseDiffDis = CoordinateUtils.calculateLineDistance(realLon,
realLat
, baseLatLng.getLongitude(), baseLatLng.getLongitude());// lon,lat, prelon, prelat
for (int i = 0; i < mRoutePoints.size(); i++) {
Location latLng = mRoutePoints.get(i);
//todo 先看index对应点的方向和realLocation方向是否一致 方向角度不能过90度
if (Math.abs(realLocation.getBearing() - latLng.getBearing()) <= 90) {
float diff = CoordinateUtils.calculateLineDistance(realLocation.getLongitude(),
realLocation.getLatitude(),
// if (Math.abs(realLocation.getBearing() - latLng.getBearing()) <= 90) {
float diff = CoordinateUtils.calculateLineDistance(realLon,
realLat,
latLng.getLongitude(), latLng.getLatitude());
if (baseDiffDis > diff) {
if (baseDiffDis > diff && i>currentIndex) {
// Logger.d(M_TAXI + "calculateRouteSumLength", "点:"+i+"-------先记录点----- ");
baseDiffDis = diff;
currentIndex = i;
}
}
// }
}
Logger.d("calculateRouteSumLength", "点:" + currentIndex + "-------是最近的点------ ");
return currentIndex;

View File

@@ -4,6 +4,7 @@ import com.mogo.eagle.core.utilcode.util.DateTimeUtils;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
/**
* @author: wangmingjun
@@ -89,4 +90,13 @@ public class DateTimeUtil {
int minute = (int)(seconds % 3600)/60;
return String.valueOf(minute);
}
/**
* 返回当前时间
* @return
*/
public static long getCurrentTimeStamp(){
return new Date().getTime();
}
}

View File

@@ -116,12 +116,14 @@ public class TaxiPassengerModel implements IOCHTaxiPassengerNaviChangedCallback
private ITaxiPassengerVeloctityCallback mVeloctityCallback;//道路限速返回
private int mPreRouteIndex = 0;
private Disposable subscribe;
private int delayTime = 2;
private double mLongitude, mLatitude;
private List<LatLng> mLocationsModels = new ArrayList<>();
private List<Location> mLocationsModels = new ArrayList<>();
private TaxiPassengerModel() {
}
@@ -425,21 +427,6 @@ public class TaxiPassengerModel implements IOCHTaxiPassengerNaviChangedCallback
}
}
/**
* 计算订单起终距离
* @return
*/
public int calculateOrderDistanceSum(){
double endLon = mCurrentOCHOrder.endSiteGcjPoint.get(0);
double endLat = mCurrentOCHOrder.endSiteGcjPoint.get(1);
double startLon = mCurrentOCHOrder.startSiteGcjPoint.get(0);
double startLat = mCurrentOCHOrder.startSiteGcjPoint.get(1);
double distance = CoordinateUtils.calculateLineDistance(
endLon, endLat,
startLon, startLat);
return new Double(distance).intValue();
}
//监听网络变化,避免启动机器时无网导致无法更新订单信息
private final IMogoIntentListener mNetWorkIntentListener = new IMogoIntentListener() {
@Override
@@ -596,10 +583,10 @@ public class TaxiPassengerModel implements IOCHTaxiPassengerNaviChangedCallback
};
public void startToRouteAndWipe(List<MessagePad.Location> models) {
List<LatLng> latLngModels = CoordinateCalculateRouteUtil
.coordinateConverterWgsToGcjListCommon(mContext,models);
List<Location> locationsModels = CoordinateCalculateRouteUtil
.coordinateConverterWgsToGcjLocations(mContext,models);
mLocationsModels.clear();
mLocationsModels.addAll(latLngModels);
mLocationsModels.addAll(locationsModels);
startOrStopRouteAndWipe(true);
showRottingMapView();
}
@@ -622,7 +609,6 @@ public class TaxiPassengerModel implements IOCHTaxiPassengerNaviChangedCallback
NaviLatLng endNaviLatLng = new NaviLatLng(orderEndStationLat,orderEndStationLng);
AmapNaviToDestinationModel.getInstance(mContext).initAMapNavi(startNaviLatLng, endNaviLatLng);
AmapNaviToDestinationModel.getInstance(mContext).setVoiceIsMute(false);
// AmapNaviToDestinationModel.getInstance(mContext).setOCHTaciNaviChangedCallback(this);
}
}
@@ -641,9 +627,16 @@ public class TaxiPassengerModel implements IOCHTaxiPassengerNaviChangedCallback
public void loopRouteAndWipe() {
if (mLocationsModels != null && mLocationsModels.size() > 0){
int haveArrivedIndex = CoordinateCalculateRouteUtil
.getArrivedPointIndex(mLocationsModels,mLongitude,mLatitude);
.getArrivedPointIndexNew(mPreRouteIndex,
mLocationsModels,
mLongitude,
mLatitude);
mPreRouteIndex = haveArrivedIndex;
if (mAutopilotPlanningCallback != null){
mAutopilotPlanningCallback.routeResultByServer(mLocationsModels,haveArrivedIndex);
List<LatLng> latLngsModels = CoordinateCalculateRouteUtil
.coordinateConverterLocationToLatLng(mContext,
mLocationsModels);
mAutopilotPlanningCallback.routeResultByServer(latLngsModels,haveArrivedIndex);
}
}
}
@@ -731,7 +724,9 @@ public class TaxiPassengerModel implements IOCHTaxiPassengerNaviChangedCallback
mAutopilotPlanningCallback.setLineMarker(data.data);
}
mLocationsModels.clear();
mLocationsModels.addAll(data.data);
List<Location> locationsModels = CoordinateCalculateRouteUtil.
coordinateConverterLatlngToLocation(data.data);
mLocationsModels.addAll(locationsModels);
startOrStopRouteAndWipe(true);
}
}else {

View File

@@ -86,6 +86,7 @@ import java.io.IOException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import io.reactivex.exceptions.UndeliverableException;
import io.reactivex.functions.Consumer;
@@ -127,9 +128,11 @@ public class TaxiModel {
private volatile boolean isRestartAutopilot = false;
private List<LatLng> mRoutePoints = new ArrayList<>();
private List<Location> mRoutePoints = new ArrayList<>();
private int mPreRouteIndex = 0;
private double mLongitude, mLatitude;
private Location mLocation = null;
private LoginService loginService;
@@ -737,8 +740,8 @@ public class TaxiModel {
public void confirmAutopilotConditionByDriver() {
if (mCurrentOCHOrder == null) return;
TaxiOrPassengerReadyReqBean.Result result = new TaxiOrPassengerReadyReqBean.Result();
result.lat = mLatitude;
result.lon = mLongitude;
// result.lat = mLatitude;
// result.lon = mLongitude;
TaxiServiceManager.confirmAutopilotConditionByDriver(mContext,
mCurrentOCHOrder.orderNo,
result,
@@ -1064,6 +1067,7 @@ public class TaxiModel {
mLongitude = location.getLongitude();
mLatitude = location.getLatitude();
mLocation = location;
if (mControllerStatusCallback != null) {
mControllerStatusCallback.onCarLocationChanged(location);
}
@@ -1333,7 +1337,8 @@ public class TaxiModel {
if (mRoutePoints.size() > 0){
mRoutePoints.clear();
}
mRoutePoints.addAll(CoordinateCalculateRouteUtil.coordinateConverterWgsToGcjListCommon(mContext, models));
mRoutePoints.addAll(CoordinateCalculateRouteUtil
.coordinateConverterWgsToGcjLocations(mContext, models));
startDynamicCalculateRouteInfo();
}
@@ -1367,47 +1372,57 @@ public class TaxiModel {
* 实时计算当前剩余里程和时间
*/
public void dynamicCalculateRouteInfo() {
if (mLatitude <= 0.0 || mLongitude <= 0.0){
if (mLocation == null){
return;
}
if (mRoutePoints.size() > 0){
List<LatLng> lastPoints = CoordinateCalculateRouteUtil
.getRemainPointListByCompare(mRoutePoints, mLongitude, mLatitude);
if (mRoutePoints.size() > 0 && mLocation != null){
Map<Integer,List<Location>> lastPointsMap = CoordinateCalculateRouteUtil
.getRemainPointListByCompareNew(mPreRouteIndex,mRoutePoints, mLocation);
float lastSumLength = 0;
if (lastPoints.size() == 1) { //只是最后一个点,计算当前位置和最后一个点的距离
lastSumLength = CoordinateUtils.calculateLineDistance(
lastPoints.get(0).longitude, lastPoints.get(0).latitude,
mLongitude, mLatitude);
} else {
lastSumLength = CoordinateCalculateRouteUtil.calculateRouteSumLength(lastPoints);
for (int index: lastPointsMap.keySet()) {
mPreRouteIndex = index;
break;
}
for (List<Location> lastPoints: lastPointsMap.values()){
float lastSumLength = 0;
if (lastPoints.size() == 1) { //只是最后一个点,计算当前位置和最后一个点的距离
lastSumLength = CoordinateUtils.calculateLineDistance(
lastPoints.get(0).getLongitude(), lastPoints.get(0).getLatitude(),
mLocation.getLongitude(), mLocation.getLatitude());
} else {
lastSumLength = CoordinateCalculateRouteUtil.calculateRouteSumLength(lastPoints);
}
double lastTime = lastSumLength / TaxiConst.TAXI_AVERAGE_SPEED * 3.6; //秒
CallerLogger.INSTANCE.d(M_TAXI + "dynamicCalculateRouteInfo"
, "---lastSumLength: " + lastSumLength + "----lastTime : " + lastTime
+ " thread = "+ Thread.currentThread().getName());
double lastTime = lastSumLength / TaxiConst.TAXI_AVERAGE_SPEED * 3.6; //秒
CallerLogger.INSTANCE.d(M_TAXI + "dynamicCalculateRouteInfo"
, "---lastSumLength: " + lastSumLength + "----lastTime : " + lastTime
+ " thread = "+ Thread.currentThread().getName());
mCurrentOCHOrder.decreaseTravelDistance(lastSumLength);
if (mOrderStatusCallback != null) {
mOrderStatusCallback.onCurrentOrderDistToEndChanged((long) lastSumLength, (long) lastTime);
mCurrentOCHOrder.decreaseTravelDistance(lastSumLength);
if (mOrderStatusCallback != null) {
mOrderStatusCallback.onCurrentOrderDistToEndChanged((long) lastSumLength, (long) lastTime);
}
reportOrderRemain((long) lastSumLength, (long) lastTime);
break;
}
reportOrderRemain((long) lastSumLength, (long) lastTime);
routeAndWipe();
}
}
private void routeAndWipe() {
if (mRoutePoints != null && mRoutePoints.size() > 0){
if (mRoutePoints != null && mRoutePoints.size() > 0 && mLocation != null){
int haveArrivedIndex = CoordinateCalculateRouteUtil
.getArrivedPointIndex(mRoutePoints,mLongitude,mLatitude);
.getArrivedPointIndexNew(mPreRouteIndex,
mRoutePoints,
mLocation.getLongitude(),
mLocation.getLatitude());
List<LatLng> routePoints = CoordinateCalculateRouteUtil
.coordinateConverterLocationToLatLng(mContext,mRoutePoints);
if (mAutopilotPlanningCallback != null){
mAutopilotPlanningCallback.routeResult(mRoutePoints,haveArrivedIndex);
mAutopilotPlanningCallback.routeResult(routePoints,haveArrivedIndex);
}
setRouteLineMarker(mRoutePoints);
setRouteLineMarker(routePoints);
}
}
@@ -1422,7 +1437,9 @@ public class TaxiModel {
public void onSuccess(QueryOrderRouteResp data) {
if (data != null && data.data != null && mRoutePoints.size() == 0) {
mRoutePoints.clear();
mRoutePoints.addAll(data.data);
List<Location> routePoints = CoordinateCalculateRouteUtil
.coordinateConverterLatlngToLocation(data.data);
mRoutePoints.addAll(routePoints);
}
}

View File

@@ -157,7 +157,6 @@ public abstract class BaseTaxiTabFragment<V extends IView, P extends Presenter<V
// mTrafficLightView = findViewById(R.id.taxi_traffic_light_view);
// CallerHmiManager.INSTANCE.setProxyTrafficLightView(mTrafficLightView);
// mPersonalBtn = findViewById(R.id.module_och_taxi_personal_layout);
mSpeedView = findViewById(R.id.module_mogo_och_speed_tv);
mCloseNaviIcon = findViewById(R.id.taxi_close_navi_icon);
flNaviPanelContainer = findViewById(R.id.module_mogo_och_navi_panel_container);

View File

@@ -19,6 +19,8 @@ import androidx.constraintlayout.widget.ConstraintLayout;
import com.amap.api.navi.model.NaviLatLng;
import com.mogo.commons.AbsMogoApplication;
import com.mogo.eagle.core.data.map.CenterLine;
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener;
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager;
import com.mogo.eagle.core.function.call.map.CallerHDMapManager;
import com.mogo.eagle.core.function.call.map.CallerSmpManager;
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
@@ -33,6 +35,7 @@ import com.mogo.och.common.module.map.ICommonNaviChangedCallback;
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.utils.ToastUtilsOch;
import com.mogo.och.common.module.voice.VoiceNotice;
import com.mogo.och.common.module.wigets.OCHCommitDialog;
import com.mogo.och.taxi.R;
@@ -451,7 +454,13 @@ public class TaxiBeingServerdOrdersFragment extends BaseTaxiUIFragment
mTaxiFragment.completeOrderService();
//VoiceNotice.showNotice(getResources().getString(R.string.module_och_taxi_order_server_completed_tip));
}else if (TaxiOrderStatusEnum.OnTheWayToEnd.getCode() == mCurrentOrder.orderStatus){//前往目的地过程中可提前结束行程
closeOrderDialog();
//自驾中提示,接管后才能结束
if (CallerAutoPilotStatusListenerManager.INSTANCE.getAutoPilotStatusInfo().getState()
== IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING){
ToastUtils.showLong(R.string.taxi_switch_line_btn_warning1);
}else {
closeOrderDialog();
}
}
}

View File

@@ -2,8 +2,6 @@ package com.mogo.och.taxi.ui;
import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_TAXI;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.ScaleDrawable;
import android.os.Build;
import android.os.Bundle;
import android.text.TextUtils;
@@ -38,8 +36,6 @@ import org.greenrobot.eventbus.ThreadMode;
import java.lang.ref.WeakReference;
import java.util.List;
import me.jessyan.autosize.utils.AutoSizeUtils;
/**
* @author congtaowang
* @since 2021/1/18
@@ -112,7 +108,6 @@ public class TaxiFragment extends BaseTaxiTabFragment<TaxiFragment, TaxiPresente
@Override
protected void initViews() {
super.initViews();
// mPersonalBtn.setVisibility(View.GONE);
initFragment();
hidPanel();
switchVRFlatMode(MogoStatusManager.getInstance().isVrMode());
@@ -192,15 +187,12 @@ public class TaxiFragment extends BaseTaxiTabFragment<TaxiFragment, TaxiPresente
mDriverRole.setVisibility(View.GONE);
}
tvOperationStatus.setText("暂停接单");
// mPersonalBtn.setVisibility(View.VISIBLE);
tvOperationStatus.setCompoundDrawablesWithIntrinsicBounds(getResources().getDrawable(R.drawable.shape_size_operation_back), null, null, null);
showPanel();
} else {
mDriverRole.setVisibility(View.GONE);
// AIAssist.getInstance(getContext()).speakTTSVoice("已接单");
tvOperationStatus.setText("接单");
tvOperationStatus.setCompoundDrawablesWithIntrinsicBounds(getResources().getDrawable(R.drawable.shape_size_operation_out), null, null, null);
// mPersonalBtn.setVisibility(View.GONE);
hidPanel();
}
}

View File

@@ -45,5 +45,8 @@
<string name="module_och_taxi_order_server_start_auto_tip">您好,本次行程共%1$s%2$s预计需要%3$d分钟我们即将出发。出于安全考虑建议您尽量不要与安全员交谈后排落座并系好安全带</string>
<string name="module_och_taxi_order_arrive_end_200m_tip">即将到达目的地,请拿好随身物品,准备下车</string>
<string name="module_och_taxi_order_auto_arrive_end_tip">您好,我们已到达目的地,本次体验结束。车辆停稳,请带好随身物品,谨防遗漏。感谢您的乘坐</string>
<string name="taxi_switch_line_btn_warning1">自动驾驶状态中,不可结束路线</string>
<!-- endregion -->
</resources>

View File

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

View File

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

View File

@@ -52,12 +52,8 @@ android {
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation rootProject.ext.dependencies.kotlinstdlibjdk7
implementation rootProject.ext.dependencies.androidxccorektx
implementation rootProject.ext.dependencies.androidxappcompat
implementation rootProject.ext.dependencies.androidxconstraintlayout
implementation rootProject.ext.dependencies.arouter
implementation rootProject.ext.dependencies.rxandroid
implementation rootProject.ext.dependencies.androidxrecyclerview
implementation rootProject.ext.dependencies.androidxroomruntime
implementation rootProject.ext.dependencies.androidxroomktx
implementation rootProject.ext.dependencies.litezxing
@@ -71,7 +67,6 @@ dependencies {
implementation rootProject.ext.dependencies.mogo_core_data
implementation rootProject.ext.dependencies.mogo_core_utils
implementation rootProject.ext.dependencies.mogo_core_res
implementation rootProject.ext.dependencies.mogo_core_network
implementation rootProject.ext.dependencies.mogo_core_function_call
} else {
@@ -81,7 +76,6 @@ dependencies {
implementation project(':core:mogo-core-data')
implementation project(':core:mogo-core-utils')
implementation project(':core:mogo-core-res')
implementation project(':core:mogo-core-network')
implementation project(':core:mogo-core-function-call')
}

View File

@@ -47,7 +47,6 @@ dependencies {
implementation rootProject.ext.dependencies.coroutinescore
implementation rootProject.ext.dependencies.arouter
kapt rootProject.ext.dependencies.aroutercompiler
implementation rootProject.ext.dependencies.mogologlib
if (Boolean.valueOf(USE_MAVEN_PACKAGE)) {
implementation rootProject.ext.dependencies.mogoserviceapi

View File

@@ -1,10 +1,13 @@
package com.mogo.eagle.core.function.report
import com.mogo.eagle.core.data.config.FunctionBuildConfig
import com.mogo.eagle.core.data.msgbox.MsgBoxBean
import com.mogo.eagle.core.data.msgbox.MsgBoxType
import com.mogo.eagle.core.data.report.ReportEntity
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager
import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxManager
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
import com.mogo.eagle.core.utilcode.util.TimeUtils
import mogo_msg.MogoReportMsg
@@ -48,7 +51,6 @@ class IPCReportManager : IMoGoAutopilotStatusListener {
*/
override fun onAutopilotGuardian(guardianInfo: MogoReportMsg.MogoReportMessage?) {
guardianInfo?.let{
//Error 弹窗并有提示音
if(it.resultList.contains(RESULT_AUTOPILOT_DISABLE)
|| it.resultList.contains(RESULT_AUTOPILOT_SYSTEM_UNSTARTED)
@@ -56,9 +58,10 @@ class IPCReportManager : IMoGoAutopilotStatusListener {
if(ipcErrorReportList.size>19){
ipcErrorReportList.removeLast()
}
ipcErrorReportList.add(0,
ReportEntity(TimeUtils.millis2String(System.currentTimeMillis()),
it.src,it.level,it.msg,it.code,it.resultList,it.actionsList))
val reportEntity = ReportEntity(TimeUtils.millis2String(System.currentTimeMillis()),
it.src,it.level,it.msg,it.code,it.resultList,it.actionsList)
CallerMsgBoxManager.saveMsgBox(MsgBoxBean(MsgBoxType.REPORT, reportEntity))
ipcErrorReportList.add(0, reportEntity)
//当前不处于美化模式时,展示监控节点上报
if(!FunctionBuildConfig.isDemoMode){
if(FunctionBuildConfig.isReportWarning){

View File

@@ -104,6 +104,7 @@ dependencies {
api rootProject.ext.dependencies.mogo_core_function_carcorder
api rootProject.ext.dependencies.mogo_core_function_call
api rootProject.ext.dependencies.mogo_core_function_api
api rootProject.ext.dependencies.mogo_core_function_msgbox
implementation project(':libraries:map-usbcamera')
implementation project(':libraries:mogo-adas-other')
@@ -134,6 +135,7 @@ dependencies {
api project(':core:function-impl:mogo-core-function-dispatch')
api project(':core:function-impl:mogo-core-function-chat')
api project(':core:function-impl:mogo-core-function-bindingcar')
api project(':core:function-impl:mogo-core-function-msgbox')
api project(':core:mogo-core-function-call')
api project(':core:mogo-core-function-api')

View File

@@ -31,9 +31,5 @@ public class WaringConst {
public static String BROADCAST_V2X_LIMITING_VELOCITY_IS_SHOW__EXTRA_KEY = "limitingVelocityIsShow";
// 限速的速度
public static String BROADCAST_V2X_LIMITING_VELOCITY_SPEED__EXTRA_KEY = "limitingVelocitySpeed";
// 交警任务
public static String NOTICE_FOR_TRAFFIC_KEY = "noticeForTraffic";
//普通公告弹框
public static String NOTICE_FOR_NORMAL_KEY = "noticeForNotice";
}

View File

@@ -3,8 +3,11 @@ package com.mogo.eagle.core.function.hmi.receiver
import android.content.BroadcastReceiver
import android.content.Context
import android.content.Intent
import com.mogo.eagle.core.data.msgbox.MsgBoxBean
import com.mogo.eagle.core.data.msgbox.MsgBoxType
import com.mogo.eagle.core.data.notice.NoticeNormalData
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager
import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxManager
import com.mogo.eagle.core.utilcode.util.SharedPrefs
/**
@@ -47,7 +50,6 @@ class NoticeNormalBroadcastReceiver : BroadcastReceiver() {
data.content = contentTv
data.videoUrl = videoUrl
data.fileType = fileType
CallerHmiManager.showNoticeNormalData(data)
}
}

View File

@@ -8,6 +8,10 @@ import com.mogo.eagle.core.function.hmi.WaringConst
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_HMI
import com.mogo.eagle.core.data.enums.EventTypeEnum
import com.mogo.eagle.core.data.msgbox.MsgBoxBean
import com.mogo.eagle.core.data.msgbox.MsgBoxType
import com.mogo.eagle.core.data.msgbox.V2XMsg
import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxManager
/**
* V2X 预警广播接收。用于跨应用,跨进程,内部也可以通过这种方式弹出预警提示框
@@ -53,7 +57,7 @@ class V2XWarningBroadcastReceiver : BroadcastReceiver() {
* 分发处理关闭场景
*/
private fun dispatchCloseWaring(tag: String?) {
CallerHmiManager.disableWarningV2X(tag)
// CallerHmiManager.disableWarningV2X(tag)
}
/**
@@ -73,6 +77,13 @@ class V2XWarningBroadcastReceiver : BroadcastReceiver() {
if (EventTypeEnum.TYPE_USECASE_ID_IVP.poiType == v2xType.toString()) {
CallerHmiManager.showLimitingVelocity(1)
}
CallerHmiManager.showWarningV2X(v2xType.toString(), alertContent, ttsContent, tag, null, true, 5000L)
CallerMsgBoxManager.saveMsgBox(
MsgBoxBean(
MsgBoxType.V2X,
V2XMsg(v2xType.toString(), alertContent, ttsContent)
)
)
CallerHmiManager.warningV2X(v2xType.toString(), alertContent, ttsContent,
tag, null, true, 5000L)
}
}

View File

@@ -23,7 +23,6 @@ import com.alibaba.android.arouter.launcher.ARouter
import com.mogo.cloud.passport.MoGoAiCloudClient
import com.mogo.commons.AbsMogoApplication
import com.mogo.commons.debug.DebugConfig
import com.mogo.eagle.core.data.enums.EventTypeEnum
import com.mogo.commons.mvp.BaseFragment
import com.mogo.commons.mvp.MvpFragment
import com.mogo.commons.voice.*
@@ -36,10 +35,14 @@ import com.mogo.eagle.core.data.config.HmiBuildConfig
import com.mogo.eagle.core.data.constants.MoGoFragmentPaths
import com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig.Companion.BIZ_RTS
import com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig.Companion.V2I
import com.mogo.eagle.core.data.enums.EventTypeEnum
import com.mogo.eagle.core.data.enums.SidePattern
import com.mogo.eagle.core.data.enums.SidePattern.*
import com.mogo.eagle.core.data.enums.WarningDirectionEnum
import com.mogo.eagle.core.data.map.Infrastructure
import com.mogo.eagle.core.data.msgbox.MsgBoxBean
import com.mogo.eagle.core.data.msgbox.MsgBoxType
import com.mogo.eagle.core.data.msgbox.RecordBagMsg
import com.mogo.eagle.core.data.notice.NoticeNormalData
import com.mogo.eagle.core.data.notice.NoticeTrafficStylePushData
import com.mogo.eagle.core.data.report.ReportEntity
@@ -63,9 +66,9 @@ import com.mogo.eagle.core.function.call.hmi.CallerHmiManager
import com.mogo.eagle.core.function.call.map.CallerMapDataCollectorManager
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager
import com.mogo.eagle.core.function.call.monitor.CallerMonitorManager
import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxManager
import com.mogo.eagle.core.function.call.telematic.CallerTelematicManager
import com.mogo.eagle.core.function.hmi.R
import com.mogo.eagle.core.function.hmi.WaringConst
import com.mogo.eagle.core.function.hmi.notification.WarningFloat
import com.mogo.eagle.core.function.hmi.notification.anim.DefaultAnimator
import com.mogo.eagle.core.function.hmi.ui.bindingcar.ModifyBindingCarDialog
@@ -73,8 +76,8 @@ import com.mogo.eagle.core.function.hmi.ui.bindingcar.ToBindingCarDialog
import com.mogo.eagle.core.function.hmi.ui.bindingcar.UpgradeAppDialog
import com.mogo.eagle.core.function.hmi.ui.camera.CameraListView
import com.mogo.eagle.core.function.hmi.ui.camera.RoadVideoDialog
import com.mogo.eagle.core.function.hmi.ui.notice.NoticeBannerView
import com.mogo.eagle.core.function.hmi.ui.notice.NoticeNormalBannerView
import com.mogo.eagle.core.function.hmi.ui.notice.NoticeCheckDialog
import com.mogo.eagle.core.function.hmi.ui.notice.NoticeTrafficDialog
import com.mogo.eagle.core.function.hmi.ui.setting.DebugSettingView
import com.mogo.eagle.core.function.hmi.ui.setting.IPCReportWindow
import com.mogo.eagle.core.function.hmi.ui.setting.ReportListFloatWindow
@@ -137,8 +140,6 @@ class MoGoHmiFragment : MvpFragment<MoGoHmiContract.View?, HmiPresenter?>(),
//StatusView
private var statusBarView: StatusBarView? = null
private var mNoticeFloat: WarningFloat.Builder? = null
// 超视距、路侧、前车直播
private var cameraListView: CameraListView? = null
private var cameraViewFloat: WarningFloat.Builder? = null
@@ -276,15 +277,19 @@ class MoGoHmiFragment : MvpFragment<MoGoHmiContract.View?, HmiPresenter?>(),
//美化模式隐藏开关
viewDemoModeSwitch.setOnClickListener {
//只在司机端设置美化模式开关功能
if(AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)){
if (AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)) {
//单次查询,是否有行程信息(订单进行中时点击不生效),autopilotControlParameters为null代表不处于自动驾驶状态下
if(CallerAutoPilotStatusListenerManager.getAutoPilotStatusInfo().autopilotControlParameters == null){
if (CallerAutoPilotStatusListenerManager.getAutoPilotStatusInfo().autopilotControlParameters == null) {
FunctionBuildConfig.isDemoMode = !FunctionBuildConfig.isDemoMode
context?.let {
CallerHmiManager.updateStatusBarRightView(FunctionBuildConfig.isDemoMode, "demoMode", DemoModeView(it))
CallerHmiManager.updateStatusBarRightView(
FunctionBuildConfig.isDemoMode,
"demoMode",
DemoModeView(it)
)
}
CallerAutoPilotManager.setDemoMode(FunctionBuildConfig.isDemoMode)
if(!FunctionBuildConfig.isDemoMode){
if (!FunctionBuildConfig.isDemoMode) {
//关闭美化模式时,通知工控机
CallerAutoPilotManager.setIPCDemoMode(FunctionBuildConfig.isDemoMode)
}
@@ -318,6 +323,14 @@ class MoGoHmiFragment : MvpFragment<MoGoHmiContract.View?, HmiPresenter?>(),
override fun onAutopilotRecordResult(recordPanel: RecordPanelOuterClass.RecordPanel) {
CallerLogger.d("$M_HMI$TAG", "recordKey=${recordPanel.key},stat=${recordPanel.stat}")
CallerMsgBoxManager.saveMsgBox(
MsgBoxBean(
MsgBoxType.RECORD, RecordBagMsg(
recordPanel.key, recordPanel.stat, recordPanel.id,
recordPanel.type, recordPanel.filename, recordPanel.note
)
)
)
if (BadCaseConfig.recordKeyList.contains(recordPanel.key)) {
if (recordPanel.stat == 100 || recordPanel.stat == 101) {
//成功结束录制
@@ -505,7 +518,7 @@ class MoGoHmiFragment : MvpFragment<MoGoHmiContract.View?, HmiPresenter?>(),
.setGravity(Gravity.LEFT)
.setImmersionStatusBar(true)
.setWindowHeight(LayoutParams.MATCH_PARENT)
.setWindowWidth(AutoSizeUtils.dp2px(context,960f))
.setWindowWidth(AutoSizeUtils.dp2px(context, 960f))
.setAnimator(object : DefaultAnimator() {
override fun enterAnim(
view: View,
@@ -688,8 +701,8 @@ class MoGoHmiFragment : MvpFragment<MoGoHmiContract.View?, HmiPresenter?>(),
.setSidePattern(side)
.setGravity(gravity, offsetY = 70)
.setImmersionStatusBar(true)
.setWindowHeight(AutoSizeUtils.dp2px(context,1100f))
.setWindowWidth(AutoSizeUtils.dp2px(context,800f))
.setWindowHeight(AutoSizeUtils.dp2px(context, 1100f))
.setWindowWidth(AutoSizeUtils.dp2px(context, 800f))
.setAnimator(object : DefaultAnimator() {
override fun enterAnim(
view: View,
@@ -741,8 +754,8 @@ class MoGoHmiFragment : MvpFragment<MoGoHmiContract.View?, HmiPresenter?>(),
.setSidePattern(side)
.setGravity(gravity, offsetY = 70)
.setImmersionStatusBar(true)
.setWindowWidth(AutoSizeUtils.dp2px(context,800f))
.setWindowHeight(AutoSizeUtils.dp2px(context,1100f))
.setWindowWidth(AutoSizeUtils.dp2px(context, 800f))
.setWindowHeight(AutoSizeUtils.dp2px(context, 1100f))
.setAnimator(object : DefaultAnimator() {
override fun enterAnim(
view: View,
@@ -898,6 +911,71 @@ class MoGoHmiFragment : MvpFragment<MoGoHmiContract.View?, HmiPresenter?>(),
}
}
/**
* 不展示顶部弹窗,其它保留
*/
@Synchronized
override fun warningV2X(
v2xType: String,
alertContent: CharSequence?,
ttsContent: String?,
tag: String?,
listener: IMoGoWarningStatusListener?,
playTts: Boolean,
expireTime: Long
) {
val playTTS =
playTts && !AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode)
activity?.let {
val warningContent = alertContent
?: EventTypeEnum.getWarningContent(v2xType)
//占道施工预警
if (v2xType.equals("10006") || v2xType.equals("100061")) {
val currentTime = System.currentTimeMillis() / 1000
val oldTime =
context?.let { it -> SharedPrefsMgr.getInstance(it).getLong("roadwork", 0) }
if (currentTime - oldTime!! > 60) { //超过一分钟,才会继续播报重复提醒
context?.let { it ->
SharedPrefsMgr.getInstance(it)
.putLong("roadwork", System.currentTimeMillis() / 1000)
}
CallerAutoPilotManager.sendTripInfo(5, "", "", "", false);
}
}
if (warningContent.isEmpty()) {
CallerLogger.e("$M_HMI$TAG", "Show warningContent is null or empty!")
return
}
listener?.onShow()
CallerLogger.d(
"$M_HMI$TAG",
"--- show v2x dialog 1 ---: info -> v2x-type: $v2xType : expireTime: $expireTime"
)
lastShowV2XJob?.safeCancel()
lastSpeakJob?.safeCancel()
lifecycleScope.launch {
delay(expireTime)
}.also { itx ->
lastShowV2XJob = itx
}.invokeOnCompletion { _ ->
listener?.onDismiss()
showWarning(WarningDirectionEnum.ALERT_WARNING_NON)
}
if (ttsContent != null && !TextUtils.isEmpty(ttsContent) && playTTS) {
lifecycleScope.launch {
speak(it, ttsContent)
}.also { itx ->
lastSpeakJob = itx
}
}
}
}
private suspend fun speak(ctx: Context, text: String) = suspendCancellableCoroutine<Unit> {
try {
val voiceCallback = object : IMogoVoiceCmdCallBack {
@@ -1055,105 +1133,37 @@ class MoGoHmiFragment : MvpFragment<MoGoHmiContract.View?, HmiPresenter?>(),
clearAnimation(flV2XWarningView)
}
private var noticeTrafficDialog: NoticeTrafficDialog? = null
/**
* 展示云公告顶部弹窗
* 展示云公告交警详情
* @param trafficStylePushData
*/
override fun showNoticeForTrafficWithData(trafficStylePushData: NoticeTrafficStylePushData?) {
if (trafficStylePushData == null) {
return
}
ThreadUtils.runOnUiThread {
activity?.let {
val noticeBannerView = this.context?.let { it1 -> NoticeBannerView(it1) }
noticeBannerView?.refreshWithData(trafficStylePushData)
mNoticeFloat = it?.let { it1 ->
noticeBannerView?.let { it2 ->
WarningFloat.with(it1)
.setTag(WaringConst.NOTICE_FOR_TRAFFIC_KEY)
.setLayout(it2)
.setSidePattern(SidePattern.TOP)
.setCountDownTime(60 * 1000 * 3)
.setGravity(Gravity.CENTER_HORIZONTAL, offsetY = 110)
.setImmersionStatusBar(true)
.addWarningStatusListener(object : IMoGoWarningStatusListener {
override fun onShow() {
// 创建弹窗成功才进行TTS播报
// AIAssist.getInstance(activity)
// .speakTTSVoice("")
}
})
.setAnimator(object : DefaultAnimator() {
override fun enterAnim(
view: View,
params: LayoutParams,
windowManager: WindowManager,
sidePattern: SidePattern
): Animator? =
super.enterAnim(view, params, windowManager, sidePattern)
?.apply {
interpolator = OvershootInterpolator()
}
override fun exitAnim(
view: View,
params: LayoutParams,
windowManager: WindowManager,
sidePattern: SidePattern
): Animator? =
super.exitAnim(view, params, windowManager, sidePattern)
?.setDuration(200)
})
.show()
}
}
context?.let {
noticeTrafficDialog = NoticeTrafficDialog(it, trafficStylePushData)
noticeTrafficDialog?.show()
}
}
}
override fun showNoticeNormalData(normalData: NoticeNormalData?) {
ThreadUtils.runOnUiThread {
activity?.let {
val noticeBannerView = this.context?.let { it1 -> NoticeNormalBannerView(it1) }
noticeBannerView?.setPushData(normalData)
mNoticeFloat = it.let { it1 ->
noticeBannerView?.let { it2 ->
WarningFloat.with(it1)
.setTag(WaringConst.NOTICE_FOR_NORMAL_KEY)
.setLayout(it2)
.setSidePattern(SidePattern.TOP)
.setCountDownTime(10000)
.setGravity(Gravity.CENTER_HORIZONTAL, offsetY = 110)
.setImmersionStatusBar(true)
.addWarningStatusListener(object : IMoGoWarningStatusListener {
override fun onShow() {
// 创建弹窗成功才进行TTS播报
// AIAssist.getInstance(activity)
// .speakTTSVoice("")
}
})
.setAnimator(object : DefaultAnimator() {
override fun enterAnim(
view: View,
params: LayoutParams,
windowManager: WindowManager,
sidePattern: SidePattern
): Animator? =
super.enterAnim(view, params, windowManager, sidePattern)
?.apply {
interpolator = OvershootInterpolator()
}
private var pushCheckDialog: NoticeCheckDialog? = null
override fun exitAnim(
view: View,
params: LayoutParams,
windowManager: WindowManager,
sidePattern: SidePattern
): Animator? =
super.exitAnim(view, params, windowManager, sidePattern)
?.setDuration(200)
})
.show()
}
}
/**
* 展示云公告详情
*/
override fun showNoticeNormalData(normalData: NoticeNormalData?) {
if (normalData == null) {
return
}
ThreadUtils.runOnUiThread {
context?.let {
pushCheckDialog = NoticeCheckDialog(it)
pushCheckDialog?.showCheckDialog(normalData)
}
}
}

View File

@@ -12,11 +12,8 @@ import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.constraintlayout.widget.ConstraintLayout;
import com.mogo.eagle.core.data.notice.NoticeTrafficStyleInfo;
import com.mogo.eagle.core.data.notice.NoticeTrafficStylePushData;
import com.mogo.eagle.core.function.hmi.R;
import com.mogo.eagle.core.function.hmi.WaringConst;
import com.mogo.eagle.core.function.hmi.notification.WarningFloat;
import com.mogo.eagle.core.utilcode.mogo.glide.GlideApp;
import com.mogo.eagle.core.utilcode.mogo.glide.transform.GlideRoundedCornersTransform;
import com.mogo.eagle.core.utilcode.util.BitmapHelper;
@@ -67,14 +64,11 @@ public class NoticeBannerView extends ConstraintLayout {
(30f, GlideRoundedCornersTransform.CornerType.LEFT)).into(styleImageView);
} else {
iconImageView.setVisibility(View.VISIBLE);
new Thread(new Runnable() {
@Override
public void run() {
Bitmap firstBitmap = BitmapHelper.getVideoThumbnail(mPushData.getPoiImgUrl());/*获取第一帧图*/
ThreadUtils.runOnUiThread(()->{
styleImageView.setImageBitmap(firstBitmap);
});
}
new Thread(() -> {
Bitmap firstBitmap = BitmapHelper.getVideoThumbnail(mPushData.getPoiImgUrl());/*获取第一帧图*/
ThreadUtils.runOnUiThread(()->{
styleImageView.setImageBitmap(firstBitmap);
});
});
};
}
@@ -89,12 +83,7 @@ public class NoticeBannerView extends ConstraintLayout {
noticeBannerCheck.setOnClickListener(v -> {
mNoticeTrafficDialog = new NoticeTrafficDialog(mContext, mPushData);
mNoticeTrafficDialog.show();
WarningFloat.dismiss(WaringConst.NOTICE_FOR_TRAFFIC_KEY);
});
}
//数据改变刷新UI
public void pushBeanChanged(NoticeTrafficStyleInfo info) {
}
}

View File

@@ -19,7 +19,6 @@ import com.mogo.eagle.core.utilcode.mogo.glide.transform.GlideRoundedCornersTran
import com.mogo.eagle.core.utilcode.util.BitmapHelper
import com.mogo.eagle.core.widget.media.video.NoticeSimpleVideoPlayer
import com.mogo.eagle.core.function.hmi.dialog.BaseFloatDialog
import com.mogo.service.IMogoServiceApis
import com.shuyu.gsyvideoplayer.GSYVideoManager
import com.shuyu.gsyvideoplayer.builder.GSYVideoOptionBuilder
import com.shuyu.gsyvideoplayer.listener.VideoAllCallBack
@@ -43,7 +42,6 @@ class NoticeCheckDialog(context: Context) : BaseFloatDialog(context), LifecycleO
private var mVideoUrl: String = ""
private var playErrorImageView: ImageView? = null
private var connectTextView: TextView? = null
private var mServiceApis: IMogoServiceApis? = null
private val statusChangedListenerForCheckNotice = IMogoStatusChangedListener { descriptor, isTrue ->
if (descriptor == StatusDescriptor.MAIN_PAGE_IS_BACKGROUND) {
dismiss()

View File

@@ -13,8 +13,6 @@ import androidx.constraintlayout.widget.ConstraintLayout;
import com.mogo.eagle.core.data.notice.NoticeNormalData;
import com.mogo.eagle.core.function.hmi.R;
import com.mogo.eagle.core.function.hmi.WaringConst;
import com.mogo.eagle.core.function.hmi.notification.WarningFloat;
import com.mogo.eagle.core.utilcode.mogo.glide.GlideApp;
import com.mogo.eagle.core.utilcode.mogo.glide.transform.GlideRoundedCornersTransform;
@@ -80,7 +78,6 @@ public class NoticeNormalBannerView extends ConstraintLayout {
}
pushCheckDialog.showCheckDialog(mPushData);
WarningFloat.dismiss(WaringConst.NOTICE_FOR_NORMAL_KEY);
});
}

View File

@@ -570,10 +570,11 @@ class DebugSettingView @JvmOverloads constructor(
}
}
Log.i(
"1026-emArrow",
"debug setting FunctionBuildConfig.isDemoMode : ${FunctionBuildConfig.isDemoMode}"
)
btnDrawFusion.isChecked = FunctionBuildConfig.isFusionColor
btnDrawFusion.setOnCheckedChangeListener{_, isChecked ->
FunctionBuildConfig.isFusionColor = isChecked
}
// 演示模式,上一次勾选的数据
tbIsDemoMode.isChecked = FunctionBuildConfig.isDemoMode
@@ -685,6 +686,7 @@ class DebugSettingView @JvmOverloads constructor(
1 -> R.id.trackerIPC
2 -> R.id.trackerIPCObu
3 -> R.id.trackerIPCV2I
4 -> R.id.trackerIPCV2nRsm
else -> R.id.trackerIPCUnion
}
)
@@ -694,6 +696,7 @@ class DebugSettingView @JvmOverloads constructor(
R.id.trackerIPC -> FunctionBuildConfig.trackerIPCProvider = 1
R.id.trackerIPCObu -> FunctionBuildConfig.trackerIPCProvider = 2
R.id.trackerIPCV2I -> FunctionBuildConfig.trackerIPCProvider = 3
R.id.trackerIPCV2nRsm -> FunctionBuildConfig.trackerIPCProvider = 4
}
}

View File

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

View File

@@ -13,7 +13,6 @@ import android.view.View;
import androidx.annotation.Nullable;
import com.mogo.eagle.core.function.hmi.R;
import com.mogo.eagle.core.function.hmi.ui.notice.NoticeBannerView;
/**

View File

@@ -64,17 +64,12 @@ class SystemVersionView @JvmOverloads constructor(
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(
// "",
// "",
@@ -82,11 +77,17 @@ class SystemVersionView @JvmOverloads constructor(
// "",
// "1"
// )
// val builder = NotificationCompat.Builder(context)
// builder.setSmallIcon(R.mipmap.icon1001)
// builder.setContentTitle("下载")
// builder.setContentText("正在下载")
// val manager: NotificationManager? = context.getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager?
//
// CallerDevaToolsUpgradeListenerManager.registerDevaToolsUpgradeListener(TAG,
// object : IMogoDevaToolsUpgradeListener {
// override fun onStart(url: String?) {
// Log.d("Package-DownLoad", " SystemVersionView onStart --------> ")
//// Log.d("Package-DownLoad", " SystemVersionView onStart --------> ")
// }
//
// override fun onPause(url: String?) {
@@ -94,36 +95,27 @@ class SystemVersionView @JvmOverloads constructor(
// }
//
// override fun onProgress(url: String?, length: Int) {
// Log.d("Package-DownLoad", " SystemVersionView onProgress length = $length")
//// 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 ------> ")
//// Log.d("Package-DownLoad", " SystemVersionView onFinished ------> ")
// builder.setContentText("已下载" + 100 + "%")
// UiThreadHandler.postDelayed({
// manager?.cancel(0x3)
// }, 500L)
// }
//
// override fun onError(url: String?, errorMsg: String?) {
// Log.d("Package-DownLoad", " errorMsg = $errorMsg")
//// Log.d("Package-DownLoad", " errorMsg = $errorMsg")
// }
// })
}
//工控机版本视图点击事件
ivAdVersion.setOnClickListener {
CallerLogger.i("$M_HMI$$TAG", "ad version view clicked")

View File

@@ -37,6 +37,7 @@ import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils;
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr;
import com.mogo.eagle.core.utilcode.util.ToastUtils;
import com.mogo.eagle.core.utilcode.util.UiThreadHandler;
import com.rousetime.android_startup.model.CostTimesModel;
import com.zhjt.service.chain.ChainLog;
import com.zhjt.service.chain.TracingConstants;
@@ -60,7 +61,7 @@ import me.jessyan.autosize.utils.AutoSizeUtils;
* @author tongchenfei
*/
public class MainLauncherActivity extends MainActivity implements IMogoIntentListener, IMoGoSkinModeChangeListener {
private static final String TAG = "liyz";
private static final String TAG = "MainLauncherActivity";
protected boolean mIsHomeKeyDown = false;
private final static Handler handlerV2XEvent = new Handler();
private static Runnable runnableV2XEvent;
@@ -71,17 +72,20 @@ public class MainLauncherActivity extends MainActivity implements IMogoIntentLis
private BluetoothMonitorReceiver mBluetoothReceiver = null;
private BluetoothAdapter mBluetoothAdapter;
// private List<BluetoothDevice> mAreadlyConnectedList = new ArrayList<>();//已连接设备集合
private int numberA = 0;
private boolean isLongPressA = false;
private int numberB = 0;
private boolean isLongPressB = false;
private int numberC = 0;
private boolean isLongPressC = false;
private int numberD = 0;
private boolean isLongPressD = false;
private int numberE = 0;
private boolean isLongPressE = false;
private boolean isShowToast = false; //toast 控制
private long startPressTime = 0; //开始按减时间
private boolean isPressEnd = false; //按键是否结束
private volatile int isCombinationKey = 0; //是否是组合按键 1单击2长按3组合
private long pressADownTime = 0;
private long pressAUpTime = 0;
private long pressBDownTime = 0;
private long pressBUpTime = 0;
private long pressCDownTime = 0;
private long pressCUpTime = 0;
private long pressDDownTime = 0;
private long pressDUpTime = 0;
private long pressEDownTime = 0;
private long pressEUpTime = 0;
@Override
@@ -90,7 +94,6 @@ public class MainLauncherActivity extends MainActivity implements IMogoIntentLis
DebugConfig.setNeedRequestUserInfo(true);
EventBus.getDefault().register(this);
CallerLogger.INSTANCE.i(M_HMI + TAG, "onCreate");
}
@Override
@@ -114,7 +117,7 @@ public class MainLauncherActivity extends MainActivity implements IMogoIntentLis
if (AppIdentityModeUtils.isBus(FunctionBuildConfig.appIdentityMode) &&
AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode)) {
FrameLayout frameLayout = findViewById(R.id.module_main_id_map_fragment_container);
frameLayout.setPadding(0, 0, AutoSizeUtils.dp2px(getContext(),700), 0);
frameLayout.setPadding(0, 0, AutoSizeUtils.dp2px(getContext(), 700), 0);
}
}
@@ -214,16 +217,12 @@ public class MainLauncherActivity extends MainActivity implements IMogoIntentLis
return super.onKeyDown(keyCode, event);
}
private long startPressTime = 0; //开始按减时间
private boolean isPressEnd = false; //按键是否结束
private boolean isCombinationKey = false; //是否是组合按键
private long pressADownTime = 0;
private long pressAUpTime = 0;
private long pressBDownTime = 0;
private long pressBUpTime = 0;
/**
* 魔方按键分发
*
* @param event
* @return
*/
@Override
public boolean dispatchKeyEvent(KeyEvent event) {
// Log.d(TAG, "dispatchKeyEvent code = " + event.getKeyCode() + "--action = " + event.getAction() + "----" + event);
@@ -231,137 +230,164 @@ public class MainLauncherActivity extends MainActivity implements IMogoIntentLis
if (!isPressEnd) {
Log.e(TAG, "dispatchKeyEvent bluetoothName = " + bluetoothName);
}
if (bluetoothName.equals("MINI_KEYBOARD")) {
if (!isPressEnd) {
isPressEnd = true;
startPressTime = System.currentTimeMillis();
}
if (event.getKeyCode() == KeyEvent.KEYCODE_A) { //单击向左变道,长按-1
if (event.getKeyCode() == KeyEvent.KEYCODE_A) { //单击 -1长按无操作AB组合-2
if (event.getAction() == KeyEvent.ACTION_DOWN) {
pressADownTime = System.currentTimeMillis();
Log.d(TAG, "dispatchKeyEvent A down pressADownTime = " + pressADownTime + "---" + (pressADownTime - startPressTime) + "----isCombinationKey = " + isCombinationKey + "--pressBDownTime = " + pressBDownTime);
if ((pressADownTime - startPressTime) > 550 && (pressADownTime - startPressTime) < 1900 && pressBDownTime > 0) {
ToastUtils.showShort("方块 A 按AB组合 -2 ");
if ((pressADownTime - startPressTime) > 320 && (pressADownTime - startPressTime) < 1300 && pressBDownTime > 0) {
if (isShowToast) {
ToastUtils.showShort("方块 A 按AB组合 -2 ");
}
sendAcc(true, -2);
isCombinationKey = true;
isCombinationKey = 3;
}
if (!isCombinationKey) {
if ((pressADownTime - startPressTime) > 2000) {
ToastUtils.showShort("方块 长按A 无操作 ");
if (isCombinationKey != 3 && isCombinationKey != 1) {
if ((pressADownTime - startPressTime) > 1320) {
if (isShowToast) {
ToastUtils.showShort("方块 长按A 无 操作 ");
}
isCombinationKey = 2;
}
}
} else if (event.getAction() == KeyEvent.ACTION_UP) {
pressAUpTime = System.currentTimeMillis();
isPressEnd = false;
isCombinationKey = false;
Log.e(TAG, "dispatchKeyEvent A up pressAUpTime = " + pressAUpTime + "---" + (pressAUpTime - startPressTime) + "--pressBDownTime = " + pressBDownTime);
if ((pressAUpTime - startPressTime) < 500) {
ToastUtils.showShort("方块 单击A -1 ");
if ((pressAUpTime - startPressTime) < 300 && isCombinationKey != 3) {
isCombinationKey = 1;
if (isShowToast) {
ToastUtils.showShort("方块 单击A -1 ");
}
sendAcc(true, -1);
}
pressAUpTime = 0;
pressADownTime = 0;
isPressEnd = false;
UiThreadHandler.postDelayed(new Runnable() {
@Override
public void run() {
isCombinationKey = 0;
}
}, 300);
}
return true;
} else if (event.getKeyCode() == KeyEvent.KEYCODE_B) { //单击向右变道,长按-2
} else if (event.getKeyCode() == KeyEvent.KEYCODE_B) {//单击复原,长按+1AB组合-2
if (event.getAction() == KeyEvent.ACTION_DOWN) {
pressBDownTime = System.currentTimeMillis();
Log.d(TAG, "dispatchKeyEvent B down pressBDownTime = " + pressBDownTime + "--差-" + (pressBDownTime - startPressTime) + "---isCombinationKey = " + isCombinationKey + "--pressADownTime = " + pressADownTime);
if ((pressBDownTime - startPressTime) > 550 && (pressBDownTime - startPressTime) < 1900 && pressADownTime > 0) {
ToastUtils.showShort("方块 B 按AB组合 ");
if ((pressBDownTime - startPressTime) > 320 && (pressBDownTime - startPressTime) < 1300 && pressADownTime > 0) {
if (isShowToast) {
ToastUtils.showShort("方块 B 按AB组合 ");
}
sendAcc(true, -2);
isCombinationKey = true;
isCombinationKey = 3;
}
if (!isCombinationKey) {
if ((pressBDownTime - startPressTime) > 2000) {
ToastUtils.showShort("方块 长按B =1 ");
if (isCombinationKey != 3 && isCombinationKey != 1) {
if ((pressBDownTime - startPressTime) > 1320) {
if (isShowToast) {
ToastUtils.showShort("方块 长按B +1 ");
}
sendAcc(true, +1);
isCombinationKey = 2;
}
}
} else if (event.getAction() == KeyEvent.ACTION_UP) {
pressBUpTime = System.currentTimeMillis();
isPressEnd = false;
isCombinationKey = false;
Log.e(TAG, "dispatchKeyEvent B up pressBUpTime = " + pressBUpTime + "--差-" + (pressBUpTime - startPressTime) + "--pressADownTime = " + pressADownTime);
if ((pressBUpTime - startPressTime) < 500) {
ToastUtils.showShort("方块 单击B 0 ");
if ((pressBUpTime - startPressTime) < 300 && isCombinationKey != 3) {
if (isShowToast) {
ToastUtils.showShort("方块 单击B 0 ");
}
sendAcc(false, 0.0);
isCombinationKey = 1;
}
pressBDownTime = 0;
isPressEnd = false;
UiThreadHandler.postDelayed(new Runnable() {
@Override
public void run() {
isCombinationKey = 0;
}
}, 300);
}
return true;
} else if (event.getKeyCode() == KeyEvent.KEYCODE_C) { //单击鸣笛,
} else if (event.getKeyCode() == KeyEvent.KEYCODE_C) { //单击左变道,长按无操作
if (event.getAction() == KeyEvent.ACTION_DOWN) {
numberC++;
if (numberC > 2) {
if (!isLongPressC) {
// ToastUtils.showShort("方块 长按C 无操作");
isLongPressC = true;
pressCDownTime = System.currentTimeMillis();
if ((pressCDownTime - startPressTime) > 1320) {
if (isShowToast) {
ToastUtils.showShort("方块 长按C 无操作 ");
}
}
} else if (event.getAction() == KeyEvent.ACTION_UP) {
if (numberC == 1) {
// ToastUtils.showShort("方块 单击C ← 向左变道 ");
pressCUpTime = System.currentTimeMillis();
isPressEnd = false;
if ((pressCUpTime - startPressTime) < 300) {
if (isShowToast) {
ToastUtils.showShort("方块 单击C ← 向左变道 ");
}
CallerAutoPilotManager.INSTANCE.sendOperatorChangeLaneLeft();
}
numberC = 0;
isLongPressC = false;
}
return true;
} else if (event.getKeyCode() == KeyEvent.KEYCODE_D) { //单击开启自动驾驶,
} else if (event.getKeyCode() == KeyEvent.KEYCODE_D) { //单击向右变道,双击无操作
if (event.getAction() == KeyEvent.ACTION_DOWN) {
numberD++;
if (numberD > 2) {
if (!isLongPressD) {
// ToastUtils.showShort("方块 长按D 无操作");
isLongPressD = true;
pressDDownTime = System.currentTimeMillis();
if ((pressDDownTime - startPressTime) > 1320) {
if (isShowToast) {
ToastUtils.showShort("方块 长按D 无操作 ");
}
}
} else if (event.getAction() == KeyEvent.ACTION_UP) {
if (numberD == 1) {
// ToastUtils.showShort("方块 单击D → 向右变道 ");
pressDUpTime = System.currentTimeMillis();
isPressEnd = false;
if ((pressDUpTime - startPressTime) < 300) {
if (isShowToast) {
ToastUtils.showShort("方块 单击D → 向右变道 ");
}
CallerAutoPilotManager.INSTANCE.sendOperatorChangeLaneRight();
}
numberD = 0;
isLongPressD = false;
}
return true;
} else if (event.getKeyCode() == KeyEvent.KEYCODE_E) { //单击复原,
} else if (event.getKeyCode() == KeyEvent.KEYCODE_E) { //单击启动自驾,长按鸣笛
if (event.getAction() == KeyEvent.ACTION_DOWN) {
numberE++;
if (numberE > 2) {
if (!isLongPressE) {
// ToastUtils.showShort("方块 长按E 鸣笛 ");
CallerAutoPilotManager.INSTANCE.sendOperatorSetHorn(1);
if (timerHorn == null) {
timerHorn = new Timer();
}
timerHorn.schedule(new TimerTask() {
@Override
public void run() {
CallerAutoPilotManager.INSTANCE.sendOperatorSetHorn(2);
timerHorn = null;
}
}, 500);
isLongPressE = true;
pressEDownTime = System.currentTimeMillis();
if ((pressEDownTime - startPressTime) > 1320) {
if (isShowToast) {
ToastUtils.showShort("方块 长按E 鸣笛 ");
}
CallerAutoPilotManager.INSTANCE.sendOperatorSetHorn(1);
if (timerHorn == null) {
timerHorn = new Timer();
}
timerHorn.schedule(new TimerTask() {
@Override
public void run() {
CallerAutoPilotManager.INSTANCE.sendOperatorSetHorn(2);
timerHorn = null;
}
}, 500);
}
} else if (event.getAction() == KeyEvent.ACTION_UP) {
if (numberE == 1) {
// ToastUtils.showShort("方块 单击E 开启自动驾驶 ");
// CallerAutoPilotManager.INSTANCE.setControlAutopilotCarAuto(true);
pressEUpTime = System.currentTimeMillis();
isPressEnd = false;
if ((pressEUpTime - startPressTime) < 300) {
if (isShowToast) {
ToastUtils.showShort("方块 单击E 开启自动驾驶 ");
}
CallerAutoPilotManager.INSTANCE.startAutoPilot(CallerAutoPilotStatusListenerManager.INSTANCE.getAutoPilotStatusInfo().getAutopilotControlParameters());
}
numberE = 0;
isLongPressE = false;
}
return true;
}
}
@@ -416,7 +442,6 @@ public class MainLauncherActivity extends MainActivity implements IMogoIntentLis
* 查找蓝牙连接过的蓝牙设备
*/
private void showBondedDevice(BluetoothAdapter bluetoothAdapter) {
// mAreadlyConnectedList.clear();
Set<BluetoothDevice> deviceList = bluetoothAdapter.getBondedDevices();
for (BluetoothDevice device : deviceList) {
try {
@@ -424,27 +449,14 @@ public class MainLauncherActivity extends MainActivity implements IMogoIntentLis
Method isConnectedMethod = BluetoothDevice.class.getDeclaredMethod("isConnected", (Class[]) null);
isConnectedMethod.setAccessible(true);
// boolean isConnected = (boolean) isConnectedMethod.invoke(device, (Object[]) null);
// mAreadlyConnectedList.add(device);
Log.d(TAG, "-- device.getName() = " + device.getName()); //device.getAddress()
if (device.getName().equals("MINI_KEYBOARD")) {
SharedPrefsMgr.getInstance(getContext()).putString("BLUETOOTH", device.getName());
}
} catch (NoSuchMethodException e) {
e.printStackTrace();
// } catch (IllegalAccessException e) {
// e.printStackTrace();
// } catch (InvocationTargetException e) {
// e.printStackTrace();
}
}
}
@Subscribe(threadMode = ThreadMode.MAIN)
public void onAutoConnection(ConnectBluetoothEvent event) {
// connectBluetooth();
}
}

View File

@@ -2,9 +2,14 @@ package com.mogo.eagle.core.function.main;
import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_HMI;
import android.app.NotificationManager;
import android.annotation.SuppressLint;
import android.content.Context;
import android.os.Process;
import androidx.annotation.Nullable;
import androidx.core.app.NotificationCompat;
import com.bytedance.boost_multidex.BoostMultiDex;
import com.elegant.utils.UiThreadHandler;
import com.mogo.cloud.socket.SocketBuildConfig;
@@ -17,14 +22,19 @@ import com.mogo.eagle.core.data.config.FunctionBuildConfig;
import com.mogo.eagle.core.data.constants.MoGoConfig;
import com.mogo.eagle.core.data.constants.MogoServicePaths;
import com.mogo.eagle.core.function.api.chat.biz.ChatConsts;
import com.mogo.eagle.core.function.api.devatools.IMogoDevaToolsUpgradeListener;
import com.mogo.eagle.core.function.call.bindingcar.CallerBindingcarManager;
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager;
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsUpgradeListenerManager;
import com.mogo.eagle.core.function.hmi.R;
import com.mogo.eagle.core.function.msgbox.db.MsgBoxDb;
import com.mogo.eagle.core.function.overview.OverviewDb;
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils;
import com.mogo.eagle.core.utilcode.mogo.AppLaunchTimeUtils;
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr;
import com.mogo.eagle.core.utilcode.util.ProcessUtils;
import com.mogo.eagle.core.utilcode.util.SPUtils;
import com.mogo.map.MapApiPath;
import com.zhidao.support.obu.ami.AmiClientManager;
import com.zhjt.mogo_core_function_devatools.monitor.db.CpuInfo;
@@ -32,6 +42,8 @@ import com.zhjt.mogo_core_function_devatools.monitor.db.MemInfo;
import com.zhjt.mogo_core_function_devatools.monitor.db.MonitorDb;
import java.lang.reflect.Field;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
/**
@@ -62,7 +74,9 @@ public abstract class MainMoGoApplication extends AbsMogoApplication {
}
//查询是否有版本的更新
queryAppUpgrade();
clearMessageBoxTable();
checkMonitorDb();
upgradeProgressListener();
}
@Override
@@ -80,6 +94,24 @@ public abstract class MainMoGoApplication extends AbsMogoApplication {
},9000);
}
@SuppressLint("SimpleDateFormat")
private void clearMessageBoxTable() {
new Thread(() -> {
String lastLaunchTimeStr = SPUtils.getInstance().getString("last_launch", "");
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
if (lastLaunchTimeStr != null && !lastLaunchTimeStr.isEmpty()) {
Date currDate = new Date(System.currentTimeMillis());
String currTimeStr = format.format(currDate);
boolean isSameDay = currTimeStr.equals(lastLaunchTimeStr);
// 超过一天需要清除消息盒子中的数据并把时间戳存入SP
if (!isSameDay) {
this.deleteDatabase(MsgBoxDb.INTERNAL_DB_NAME);
SPUtils.getInstance().put("last_launch", currTimeStr);
}
}
}).start();
}
private void checkMonitorDb() {
new Thread(() -> {
long limitId = 50001;
@@ -92,6 +124,50 @@ public abstract class MainMoGoApplication extends AbsMogoApplication {
}).start();
}
private void upgradeProgressListener() {
final NotificationCompat.Builder builder = new NotificationCompat.Builder(this);
builder.setSmallIcon(R.mipmap.icon1001);
builder.setContentTitle("下载");
builder.setContentText("正在下载");
final NotificationManager manager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
CallerDevaToolsUpgradeListenerManager.INSTANCE.registerDevaToolsUpgradeListener(TAG, new IMogoDevaToolsUpgradeListener() {
@Override
public void onStart(@Nullable String url) {
}
@Override
public void onPause(@Nullable String url) {
}
@Override
public void onProgress(@Nullable String url, int length) {
builder.setProgress(100, length,false);
manager.notify(0x3, builder.build());
//下载进度提示
builder.setContentText("已下载" + length + "%");
}
@Override
public void onFinished(@Nullable String url) {
builder.setContentText("已下载" + 100 + "%");
UiThreadHandler.postDelayed(new Runnable() {
@Override
public void run() {
manager.cancel(0x3);
}
}, 1000);
}
@Override
public void onError(@Nullable String url, @Nullable String errorMsg) {
}
});
}
private void initKoom() {
KoomInitTask.INSTANCE.init(this);
}

View File

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

View File

@@ -80,7 +80,6 @@ dependencies {
implementation rootProject.ext.dependencies.mogomap
implementation rootProject.ext.dependencies.mogomapapi
implementation rootProject.ext.dependencies.moduleservice
} else {
implementation project(':modules:mogo-module-common')
implementation project(':services:mogo-service-api')
@@ -93,7 +92,6 @@ dependencies {
implementation project(":libraries:mogo-map")
implementation project(":libraries:mogo-map-api")
implementation project(':libraries:mogo-adas')
}
}

View File

@@ -9,9 +9,9 @@ object TrackerSourceColorHelper {
@SuppressLint("NewApi")
fun filterData(data: TrackedObject): Boolean {
if (!FunctionBuildConfig.isDrawUnknownIdentifyData
&& data.type == TrafficTypeEnum.TYPE_TRAFFIC_ID_WEI_ZHI.type
) {
if (!FunctionBuildConfig.isDrawUnknownIdentifyData && data.type == TrafficTypeEnum.TYPE_TRAFFIC_ID_WEI_ZHI.type
|| data.type == TrafficTypeEnum.TYPE_TRAFFIC_ID_501.type || data.type == TrafficTypeEnum.TYPE_TRAFFIC_ID_502.type
) {
return true
}
var trackIPCFilter = true
@@ -30,6 +30,11 @@ object TrackerSourceColorHelper {
trackIPCFilter = false
}
}
4 -> {
if(isV2nRSM(data).second){
trackIPCFilter = false
}
}
}
return trackIPCFilter
}
@@ -46,7 +51,7 @@ object TrackerSourceColorHelper {
color = "#00AEFFFF"
}
//等级最高
//level : 2
if (isObu(data).second) {
color = "#36D3FEFF"
// obu预警
@@ -58,8 +63,13 @@ object TrackerSourceColorHelper {
}
}
//融合结果 level : 1
if (isFusion(data)) {
color = "#9900ffFF"
}
// pnc预警
WarningHelper.getPncColor(data.uuid.toString()){
WarningHelper.getPncColor(data.uuid.toString()) {
if (it.isNotBlank()) {
color = it
}
@@ -72,10 +82,21 @@ object TrackerSourceColorHelper {
*/
@SuppressLint("NewApi")
fun isIPC(data: TrackedObject): Boolean {
val source = data.trackedSourceList.stream().allMatch {
it.source != 4
return if (data.trackedSourceList.size == 1) { // 如果仅有一个类型
val source = data.trackedSourceList.stream().allMatch {
it.source == 1
}
source
} else {
false
}
return source
}
/**
* 是否为融合数据,融合数据来源size >=2
*/
fun isFusion(data: TrackedObject): Boolean {
return FunctionBuildConfig.isFusionColor && data.trackedSourceList.size > 1
}
/**
@@ -84,11 +105,11 @@ object TrackerSourceColorHelper {
@SuppressLint("NewApi")
fun isObu(data: TrackedObject): Pair<SubSource?, Boolean> {
val source = data.trackedSourceList.stream().anyMatch {
it.source == 4
it.source == 2
}
if (source) {
val first = data.trackedSourceList.stream()
.filter { trackedSource: TrackedSource -> trackedSource.source == 4 }.findFirst()
.filter { trackedSource: TrackedSource -> trackedSource.source == 2 }.findFirst()
if (first.isPresent) {
val subObu = first.get().subSourceList.stream().anyMatch {
it.source == 1
@@ -111,26 +132,59 @@ object TrackerSourceColorHelper {
*/
@SuppressLint("NewApi")
fun isV2I(data: TrackedObject): Pair<SubSource?, Boolean> {
val source = data.trackedSourceList.stream().allMatch {
it.source == 4
}
if (source) {
val first = data.trackedSourceList.stream()
.filter { trackedSource: TrackedSource -> trackedSource.source == 4 }.findFirst()
if (first.isPresent) {
val subV2I = first.get().subSourceList.stream().allMatch {
it.source == 6
}
if (subV2I) {
val subFirst = first.get().subSourceList.stream()
.filter { subSource: SubSource -> subSource.source == 6 }
.findFirst()
if (subFirst.isPresent) {
return Pair(subFirst.get(), true)
if (data.trackedSourceList.size == 1) { // 如果仅有一个类型
val source = data.trackedSourceList.stream().allMatch { it.source == 2 }
if (source) {
val first = data.trackedSourceList.stream()
.filter { trackedSource: TrackedSource -> trackedSource.source == 2 }
.findFirst()
if (first.isPresent) {
val subV2I = first.get().subSourceList.stream().allMatch {
it.source == 6
}
if (subV2I) {
val subFirst = first.get().subSourceList.stream()
.filter { subSource: SubSource -> subSource.source == 6 }
.findFirst()
if (subFirst.isPresent) {
return Pair(subFirst.get(), true)
}
}
}
}
}
return Pair(null, false)
}
/**
* 过滤所有 v2n 感知数据 all match
*/
@SuppressLint("NewApi")
fun isV2nRSM(data: TrackedObject): Pair<SubSource?, Boolean> {
if (data.trackedSourceList.size == 1) { // 如果仅有一个类型
val source = data.trackedSourceList.stream().allMatch { it.source == 2 }
if (source) {
val first = data.trackedSourceList.stream()
.filter { trackedSource: TrackedSource -> trackedSource.source == 2 }
.findFirst()
if (first.isPresent) {
val subV2nRSM = first.get().subSourceList.stream().allMatch {
it.source == 4
}
if (subV2nRSM) {
val subFirst = first.get().subSourceList.stream()
.filter { subSource: SubSource -> subSource.source == 4 }
.findFirst()
if (subFirst.isPresent) {
return Pair(subFirst.get(), true)
}
}
}
}
}
return Pair(null, false)
}
}

View File

@@ -55,21 +55,15 @@ dependencies {
implementation rootProject.ext.dependencies.androidxroomktx
if (Boolean.valueOf(USE_MAVEN_PACKAGE)) {
// implementation rootProject.ext.dependencies.modulecommon
// implementation rootProject.ext.dependencies.moduleservice
implementation rootProject.ext.dependencies.mogo_core_data
implementation rootProject.ext.dependencies.mogo_core_utils
implementation rootProject.ext.dependencies.mogo_core_function_api
implementation rootProject.ext.dependencies.mogo_core_function_call
implementation rootProject.ext.dependencies.mogo_core_res
} else {
// implementation project(':modules:mogo-module-common')
// implementation project(':modules:mogo-module-service')
implementation project(':core:mogo-core-data')
implementation project(':core:mogo-core-utils')
implementation project(':core:mogo-core-function-api')
implementation project(':core:mogo-core-function-call')
implementation project(':core:mogo-core-res')
}
}

View File

@@ -1,55 +1,91 @@
package com.mogo.eagle.core.function.msgbox
import android.content.Context
import android.os.Looper
import com.mogo.eagle.core.data.msgbox.MsgBoxBean
import com.mogo.eagle.core.data.msgbox.MsgBoxType
import com.mogo.eagle.core.data.msgbox.MsgCategory
import com.mogo.eagle.core.data.msgbox.*
import com.mogo.eagle.core.data.notice.NoticeNormalData
import com.mogo.eagle.core.data.report.ReportEntity
import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxListenerManager
import com.mogo.eagle.core.function.msgbox.db.MsgBoxDb
import com.mogo.eagle.core.function.msgbox.db.MsgBoxInfo
import com.mogo.eagle.core.utilcode.kotlin.lifeCycleScope
import com.mogo.eagle.core.utilcode.util.GsonUtils
import com.mogo.eagle.core.utilcode.util.Utils
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.launch
import kotlinx.coroutines.withContext
object DataManager {
// private val msgBoxMap: EnumMap<MsgBoxType, MutableList<MsgBoxBean>> = EnumMap(MsgBoxType::class.java)
// 消失时间5000ms
const val DISMISS_TIME = 5000L
private val notifyList by lazy {
mutableListOf<MsgBoxBean>()
}
/**
* 当天缓存的通知消息
*/
private val cacheNotifyList by lazy {
mutableListOf<MsgBoxBean>()
}
private val sysInfoList by lazy {
mutableListOf<MsgBoxBean>()
}
/**
* 当天缓存的系统消息
*/
private val cacheSysInfoList by lazy {
mutableListOf<MsgBoxBean>()
}
private val recordBagList by lazy {
mutableListOf<MsgBoxBean>()
}
@Volatile
private var isUpdate = false
/**
* 当天缓存的录包消息
*/
private val cacheRecordList by lazy {
mutableListOf<MsgBoxBean>()
}
private val scope by lazy {
Utils.getApp().lifeCycleScope
}
/**
* 用户取消给录制的Bag包打标签
*/
private val removedRecordMap by lazy {
HashMap<String, Any>()
}
/**
* 存储时保证按时序排列
*/
fun saveMsg(bean: MsgBoxBean) {
if (Thread.currentThread() == Looper.getMainLooper().thread) {
scope.launch(Dispatchers.Default) {
realSaveMsg(bean)
scope.launch {
withContext(Dispatchers.Default) {
realSaveMsg(bean)
}
}
} else {
realSaveMsg(bean)
}
}
fun realSaveMsg(bean: MsgBoxBean) {
private fun realSaveMsg(bean: MsgBoxBean) {
val type = bean.type
bean.timestamp = System.currentTimeMillis()
when(type) {
bean.bean2Json = GsonUtils.toJson(bean)
when (type) {
MsgBoxType.V2X, MsgBoxType.OBU, MsgBoxType.NOTICE, MsgBoxType.OPERATION -> {
synchronized(this) {
notifyList.add(bean)
@@ -76,20 +112,162 @@ object DataManager {
* 通知消息V2X、云公告、运营信息
*/
fun getNotifyData(): List<MsgBoxBean> {
return notifyList
return cacheNotifyList
}
/**
* 工控机Report信息
*/
fun getSysInfoData(): List<MsgBoxBean> {
return sysInfoList
return cacheSysInfoList
}
/**
* 录包信息
*/
fun getRecordBagData(): List<MsgBoxBean> {
return recordBagList
return cacheRecordList
}
fun removeRecordInfo(key: String, value: Any) {
removedRecordMap[key] = value
}
/**
* 从本地数据库中查询数据
*/
fun queryAllMessages(context: Context) {
scope.launch {
getCacheMessages(context)
}
}
private suspend fun getCacheMessages(context: Context): List<MsgBoxBean> = withContext(Dispatchers.IO) {
return@withContext MsgBoxDb.getDb(context)
.monitorDao()
.getAllCachedMessages()
.map { msgInfo ->
val json = msgInfo.bean2Json
when (msgInfo.obj2JsonType) {
MsgBoxType.V2X.ordinal -> {
return@map MsgBoxBean(
MsgBoxType.V2X,
GsonUtils.fromJson(json, V2XMsg::class.java)
).apply {
withContext(Dispatchers.Main) {
cacheNotifyList.add(this@apply)
}
}
}
MsgBoxType.OBU.ordinal -> {
return@map MsgBoxBean(
MsgBoxType.OBU,
GsonUtils.fromJson(json, V2XMsg::class.java)
).apply {
withContext(Dispatchers.Main) {
cacheNotifyList.add(this@apply)
}
}
}
MsgBoxType.OPERATION.ordinal -> {
return@map MsgBoxBean(
MsgBoxType.OPERATION,
GsonUtils.fromJson(json, OperationMsg::class.java)
).apply {
withContext(Dispatchers.Main) {
cacheNotifyList.add(this@apply)
}
}
}
MsgBoxType.REPORT.ordinal -> {
return@map MsgBoxBean(
MsgBoxType.REPORT,
GsonUtils.fromJson(json, ReportEntity::class.java)
).apply {
withContext(Dispatchers.Main) {
cacheSysInfoList.add(this@apply)
}
}
}
MsgBoxType.RECORD.ordinal -> {
return@map MsgBoxBean(
MsgBoxType.RECORD,
GsonUtils.fromJson(json, RecordBagMsg::class.java)
).apply {
withContext(Dispatchers.Main) {
cacheRecordList.add(this@apply)
}
}
}
MsgBoxType.NOTICE.ordinal -> {
return@map MsgBoxBean(
MsgBoxType.NOTICE,
GsonUtils.fromJson(json, NoticeNormalData::class.java)
).apply {
withContext(Dispatchers.Main) {
cacheNotifyList.add(this@apply)
}
}
}
else -> {
return@map MsgBoxBean(MsgBoxType.V2X, V2XMsg())
}
}
}
}
/**
* 存储到本地数据库
*/
fun saveAllMessages2Disk(context: Context) {
synchronized(this) {
val msgInfoList = ArrayList<MsgBoxInfo>()
if (notifyList.isNotEmpty()) {
notifyList.forEach {
msgInfoList.add(MsgBoxInfo(it.bean2Json, it.type.ordinal, it.timestamp))
}
notifyList.clear()
}
if (sysInfoList.isNotEmpty()) {
sysInfoList.forEach {
msgInfoList.add(MsgBoxInfo(it.bean2Json, it.type.ordinal, it.timestamp))
}
sysInfoList.clear()
}
if (recordBagList.isNotEmpty()) {
recordBagList.forEach {
var recordKey = ""
if (it.bean is RecordBagMsg) {
recordKey = (it.bean as RecordBagMsg).key.toString()
}
// 用户未处理的Bag包才存本地
if (!removedRecordMap.contains(recordKey)) {
msgInfoList.add(MsgBoxInfo(it.bean2Json, it.type.ordinal, it.timestamp))
} else {// 用户已处理的Bag包
removedRecordMap.remove(recordKey)
}
}
recordBagList.clear()
}
if (msgInfoList.isNotEmpty()) {
MsgBoxDb.getDb(context)
.monitorDao()
.insertMessages(*msgInfoList.toTypedArray())
}
}
}
fun delMsgBoxBean(context: Context, msgBoxBean: MsgBoxBean) {
scope.launch {
withContext(Dispatchers.Default) {
val msgBoxInfo = MsgBoxInfo(msgBoxBean.bean2Json, msgBoxBean.type.ordinal, msgBoxBean.timestamp)
MsgBoxDb.getDb(context)
.monitorDao()
.deleteMsg(msgBoxInfo)
}
}
}
}

View File

@@ -5,6 +5,7 @@ import com.alibaba.android.arouter.facade.annotation.Route
import com.mogo.eagle.core.data.constants.MogoServicePaths.PATH_MSG_BOX_MODULE
import com.mogo.eagle.core.data.msgbox.MsgBoxBean
import com.mogo.eagle.core.function.api.msgbox.IMsgBoxProvider
import com.mogo.eagle.core.function.msgbox.DataManager.saveAllMessages2Disk
@Route(path = PATH_MSG_BOX_MODULE)
class MsgBoxProvider : IMsgBoxProvider {
@@ -13,25 +14,43 @@ class MsgBoxProvider : IMsgBoxProvider {
get() = "MsgBoxProvider"
override fun init(context: Context) {
context
Thread {
while (true) {
try {
saveAllMessages2Disk(context)
Thread.sleep(3000)
} catch (e: Exception) {
e.printStackTrace()
}
}
}.start()
}
override fun saveMsg(bean: MsgBoxBean) {
DataManager.saveMsg(bean)
}
override fun getNotifyData(): List<MsgBoxBean> {
override fun getCachedNotifyData(): List<MsgBoxBean> {
return DataManager.getNotifyData()
}
override fun getSysInfoData(): List<MsgBoxBean> {
override fun getCachedSysInfoData(): List<MsgBoxBean> {
return DataManager.getSysInfoData()
}
override fun getRecordBagData(): List<MsgBoxBean> {
override fun getCachedRecordBagData(): List<MsgBoxBean> {
return DataManager.getRecordBagData()
}
override fun removeRecordInfo(context: Context, msgBoxBean: MsgBoxBean, key: String) {
DataManager.removeRecordInfo(key, key)
DataManager.delMsgBoxBean(context, msgBoxBean)
}
override fun getDismissTime(): Long {
return DataManager.DISMISS_TIME
}
override fun onDestroy() {
}

View File

@@ -5,5 +5,14 @@ import androidx.room.*
@Dao
interface MsgBoxDao {
@Insert(onConflict = OnConflictStrategy.REPLACE)
fun saveMsg(info: MsgBoxInfo)
fun insertMessage(info: MsgBoxInfo)
@Insert(onConflict = OnConflictStrategy.REPLACE)
fun insertMessages(vararg info: MsgBoxInfo)
@Delete
suspend fun deleteMsg(info: MsgBoxInfo)
@Query("SELECT * FROM t_msg_box")
fun getAllCachedMessages(): List<MsgBoxInfo>
}

View File

@@ -6,10 +6,13 @@ import androidx.room.PrimaryKey
@Entity(tableName = "t_msg_box")
data class MsgBoxInfo(
@PrimaryKey(autoGenerate = true)
@ColumnInfo(name = "id")
val uuid: Long = 0,
@PrimaryKey
@ColumnInfo(name = "obj_json")
val bean2Json: String,
@ColumnInfo(name = "obj_str")
val objString: String
@ColumnInfo(name = "json_obj_type")
val obj2JsonType: Int = 0,
@ColumnInfo(name = "time_stamp")
val timeStamp: Long = 0
)

View File

@@ -5,9 +5,11 @@ import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_NOT
import android.content.Context;
import com.mogo.aicloud.services.socket.MogoAiCloudSocketManager;
import com.mogo.eagle.core.data.msgbox.MsgBoxBean;
import com.mogo.eagle.core.data.msgbox.MsgBoxType;
import com.mogo.eagle.core.data.notice.NoticeNormalData;
import com.mogo.eagle.core.data.notice.NoticeTrafficStylePushData;
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager;
import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxManager;
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
import com.mogo.eagle.core.network.utils.GsonUtil;
import com.mogo.aicloud.services.socket.IMogoOnMessageListener;
@@ -61,7 +63,7 @@ class NoticeSocketManager {
if (obj == null) {
return;
}
CallerHmiManager.INSTANCE.showNoticeNormalData(obj);
CallerMsgBoxManager.INSTANCE.saveMsgBox(new MsgBoxBean(MsgBoxType.NOTICE,obj));
}
};
@@ -78,7 +80,7 @@ class NoticeSocketManager {
@Override
public void onMsgReceived(NoticeTrafficStylePushData obj) {
CallerLogger.INSTANCE.d(M_NOTICE + TAG, "301001-- 交警类型公告数据:" + GsonUtil.jsonFromObject(obj));
CallerHmiManager.INSTANCE.showTrafficBanner(obj);
CallerMsgBoxManager.INSTANCE.saveMsgBox(new MsgBoxBean(MsgBoxType.NOTICE,obj));
}
};
}

View File

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

View File

@@ -4,6 +4,7 @@ import android.content.Context
import android.util.Log
import com.alibaba.android.arouter.launcher.ARouter
import com.mogo.cloud.passport.MoGoAiCloudClientConfig
import com.mogo.commons.voice.AIAssist
import com.mogo.eagle.core.data.app.AppConfigInfo
import com.mogo.eagle.core.data.config.FunctionBuildConfig
import com.mogo.eagle.core.data.constants.MogoServicePaths
@@ -22,6 +23,10 @@ import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_
import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr
import com.mogo.eagle.core.data.enums.EventTypeEnum
import com.mogo.eagle.core.data.enums.EventTypeHelper
import com.mogo.eagle.core.data.msgbox.MsgBoxBean
import com.mogo.eagle.core.data.msgbox.MsgBoxType
import com.mogo.eagle.core.data.msgbox.V2XMsg
import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxManager
import com.mogo.service.IMogoServiceApis
import com.zhidao.support.obu.MogoObuManager
import com.zhidao.support.obu.OnMogoObuListener
@@ -373,8 +378,16 @@ class MogoPrivateObuManager private constructor() {
//显示警告红边 TODO 需要确定是什么值
// CallerHmiManager.showWarning(direction)
//显示弹框,语音提示
CallerHmiManager.showWarningV2X(
//显示弹框,其它保留
CallerMsgBoxManager.saveMsgBox(
MsgBoxBean(
MsgBoxType.OBU,
V2XMsg(appId,
alertContent,
ttsContent)
)
)
CallerHmiManager.warningV2X(
appId,
alertContent,
ttsContent,// 只有第一次才tts防止更新的时候不断的提醒
@@ -400,7 +413,7 @@ class MogoPrivateObuManager private constructor() {
// 关闭警告红边
CallerHmiManager.showWarning(WarningDirectionEnum.ALERT_WARNING_NON)
// 移除顶部弹窗
CallerHmiManager.disableWarningV2X((appId + direction.direction).toString())
// CallerHmiManager.disableWarningV2X((appId + direction.direction).toString())
// 更新数据
TrafficDataConvertUtils.cvxRtiThreatIndInfo2TrafficData(info)?.let {
CallerObuListenerManager.removeTrackerWarningInfo(it)
@@ -493,7 +506,15 @@ class MogoPrivateObuManager private constructor() {
// if (level == 2 || level == 3) { //不考虑level
//显示警告红边
CallerHmiManager.showWarning(direction)
CallerHmiManager.showWarningV2X(
CallerMsgBoxManager.saveMsgBox(
MsgBoxBean(
MsgBoxType.OBU,
V2XMsg(v2xType,
alertContent,
ttsContent)
)
)
CallerHmiManager.warningV2X(
v2xType,
alertContent,
ttsContent,// 只有第一次才tts防止更新的时候不断的提醒
@@ -527,7 +548,7 @@ class MogoPrivateObuManager private constructor() {
CallerMapUIServiceManager.getMarkerService()
?.updateITrafficThreatLevelInfo(it)
}
CallerHmiManager.disableWarningV2X(ObuConstants.USE_CASE_ID.VRUCW.toString())
// CallerHmiManager.disableWarningV2X(ObuConstants.USE_CASE_ID.VRUCW.toString())
}
}
@@ -664,7 +685,7 @@ class MogoPrivateObuManager private constructor() {
ObuConstants.STATUS.DELETE -> {
// 移除顶部弹窗
CallerHmiManager.disableWarningTrafficLight()
CallerHmiManager.disableWarningV2X(appId.toString())
// CallerHmiManager.disableWarningV2X(appId.toString())
}
}
}
@@ -695,12 +716,18 @@ class MogoPrivateObuManager private constructor() {
0x0 -> {//不可用 V2I_RLVW_VIOLATION_TYPE_UNAVAILABLE
}
0x1 -> {//无违规 V2I_RLVW_VIOLATION_TYPE_NO_VIOLATION
CallerHmiManager.disableWarningV2X(appId.toString())
// CallerHmiManager.disableWarningV2X(appId.toString())
}
0x2 -> {//闯红灯 V2I_RLVW_VIOLATION_TYPE_RUNNING_RED_LIGHT
ttsContent = EventTypeEnum.getWarningTts(appId.toString())
alertContent = EventTypeEnum.getWarningContent(appId.toString())
CallerHmiManager.showWarningV2X(
CallerMsgBoxManager.saveMsgBox(
MsgBoxBean(
MsgBoxType.OBU,
V2XMsg(appId.toString(), alertContent, ttsContent)
)
)
CallerHmiManager.warningV2X(
appId.toString(), alertContent, ttsContent,// 只有第一次才tts防止更新的时候不断的提醒
appId.toString(), null, true, 5000L
)
@@ -717,7 +744,7 @@ class MogoPrivateObuManager private constructor() {
// 红灯
0x1 -> {
if (!isRedLight) {
CallerHmiManager.disableWarningV2X(appId.toString())
// CallerHmiManager.disableWarningV2X(appId.toString())
isRedLight = true
}
isGreenLight = false
@@ -732,7 +759,7 @@ class MogoPrivateObuManager private constructor() {
// 绿灯
0x2 -> {
if (!isGreenLight) {
CallerHmiManager.disableWarningV2X(appId.toString())
// CallerHmiManager.disableWarningV2X(appId.toString())
isGreenLight = true
}
isRedLight = false
@@ -767,7 +794,15 @@ class MogoPrivateObuManager private constructor() {
val maxSpeed = currentLight.glosa_suggested_speed_max.toInt()
if (maxSpeed > 0) {
CallerHmiManager.showWarningV2X(
CallerMsgBoxManager.saveMsgBox(
MsgBoxBean(
MsgBoxType.OBU,
V2XMsg(EventTypeEnum.TYPE_USECASE_ID_IVP_GREEN.poiType,
alertContent,
ttsContent)
)
)
CallerHmiManager.warningV2X(
EventTypeEnum.TYPE_USECASE_ID_IVP_GREEN.poiType,
alertContent,
ttsContent,// 只有第一次才tts防止更新的时候不断的提醒
@@ -780,7 +815,7 @@ class MogoPrivateObuManager private constructor() {
}
// 黄灯
0x3 -> {
CallerHmiManager.disableWarningV2X(appId.toString())
// CallerHmiManager.disableWarningV2X(appId.toString())
CallerHmiManager.showWarningTrafficLight(2, 2)
val yellow = currentLight.count_down.toInt()
CallerHmiManager.changeCountdownYellow(yellow)
@@ -890,8 +925,16 @@ class MogoPrivateObuManager private constructor() {
"appId2 = $appId --- level = $level ---ttsContent = $ttsContent --- alertContent = $alertContent --- direction = $direction"
)
if (level == 2 || level == 3) {
//显示弹框,语音提示
CallerHmiManager.showWarningV2X(
//显示顶部弹框,其它保留
CallerMsgBoxManager.saveMsgBox(
MsgBoxBean(
MsgBoxType.OBU,
V2XMsg(appId.toString(),
alertContent,
ttsContent)
)
)
CallerHmiManager.warningV2X(
appId.toString(),
alertContent,
ttsContent,// 只有第一次才tts防止更新的时候不断的提醒
@@ -930,7 +973,7 @@ class MogoPrivateObuManager private constructor() {
// 关闭警告红边
CallerHmiManager.showWarning(WarningDirectionEnum.ALERT_WARNING_NON)
// 移除顶部弹窗
CallerHmiManager.disableWarningV2X((appId + direction.direction).toString())
// CallerHmiManager.disableWarningV2X((appId + direction.direction).toString())
//更新周边车辆进行预警颜色变换,车辆实时移动和变色
TrafficDataConvertUtils.cvxV2vThreatIndInfo2TrafficData(info)?.let {
CallerObuListenerManager.removeTrackerWarningInfo(it)

View File

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

View File

@@ -25,6 +25,9 @@ import com.mogo.eagle.core.data.map.entity.MarkerExploreWay
import com.mogo.eagle.core.data.map.entity.MarkerShowEntity
import com.mogo.eagle.core.data.map.entity.V2XMessageEntity
import com.mogo.eagle.core.data.map.entity.V2XRoadEventEntity
import com.mogo.eagle.core.data.msgbox.MsgBoxBean
import com.mogo.eagle.core.data.msgbox.MsgBoxType
import com.mogo.eagle.core.data.msgbox.V2XMsg
import com.mogo.eagle.core.data.traffic.*
import com.mogo.eagle.core.function.api.hmi.warning.*
import com.mogo.eagle.core.function.api.map.listener.*
@@ -32,6 +35,7 @@ import com.mogo.eagle.core.function.call.hmi.*
import com.mogo.eagle.core.function.call.map.*
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.msgbox.CallerMsgBoxManager
import com.mogo.eagle.core.function.v2x.events.alarm.*
import com.mogo.eagle.core.function.v2x.events.bridge.*
import com.mogo.eagle.core.function.v2x.events.bridge.BridgeApi.context
@@ -571,8 +575,16 @@ object V2XEventManager : IMoGoMapLocationListener, IMoGoTokenCallback, IV2XCallb
}
}
}
// 显示弹框,语音提示
CallerHmiManager.showWarningV2X(
// 显示弹框,其它保留
CallerMsgBoxManager.saveMsgBox(
MsgBoxBean(
MsgBoxType.OBU,
V2XMsg(tempAppId.toString(),
tempContent,
tempTts)
)
)
CallerHmiManager.warningV2X(
tempAppId.toString(),
tempContent,
tempTts,

View File

@@ -7,9 +7,13 @@ import com.mogo.eagle.core.data.enums.WarningDirectionEnum;
import com.mogo.eagle.core.data.map.entity.MarkerExploreWay;
import com.mogo.eagle.core.data.map.entity.V2XMessageEntity;
import com.mogo.eagle.core.data.map.entity.V2XRoadEventEntity;
import com.mogo.eagle.core.data.msgbox.MsgBoxBean;
import com.mogo.eagle.core.data.msgbox.MsgBoxType;
import com.mogo.eagle.core.data.msgbox.V2XMsg;
import com.mogo.eagle.core.function.api.hmi.warning.IMoGoWarningStatusListener;
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager;
import com.mogo.eagle.core.function.call.map.CallerVisualAngleManager;
import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxManager;
import com.mogo.eagle.core.function.v2x.events.consts.V2XConst;
import com.mogo.eagle.core.function.v2x.events.manager.V2XStatusManager;
import com.mogo.eagle.core.function.v2x.events.scenario.impl.AbsV2XScenario;
@@ -93,8 +97,18 @@ public class V2XRoadEventScenario extends AbsV2XScenario<V2XRoadEventEntity> imp
V2XMessageEntity<V2XRoadEventEntity> entity = getV2XMessageEntity();
V2XRoadEventEntity content = entity != null ? entity.getContent() : null;
if (content != null) {
//显示警告红边
CallerHmiManager.INSTANCE.showWarningV2X(content.getPoiType(), content.getAlarmContent(), content.getTts(), TAG, this, !entity.isOnlyShow(), TimeUnit.SECONDS.toMillis(5));
// //显示警告红边
CallerMsgBoxManager.INSTANCE.saveMsgBox(
new MsgBoxBean(
MsgBoxType.V2X,
new V2XMsg(content.getPoiType(),
content.getAlarmContent(),
content.getTts())
)
);
CallerHmiManager.INSTANCE.warningV2X(content.getPoiType(), content.getAlarmContent(),
content.getTts(), TAG, this, !entity.isOnlyShow(),
TimeUnit.SECONDS.toMillis(5));
}
}

View File

@@ -5,8 +5,12 @@ import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_V2X
import androidx.annotation.Nullable;
import com.mogo.eagle.core.data.map.entity.V2XMessageEntity;
import com.mogo.eagle.core.data.msgbox.MsgBoxBean;
import com.mogo.eagle.core.data.msgbox.MsgBoxType;
import com.mogo.eagle.core.data.msgbox.V2XMsg;
import com.mogo.eagle.core.function.api.hmi.warning.IMoGoWarningStatusListener;
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager;
import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxManager;
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
import com.mogo.eagle.core.function.v2x.events.bridge.BridgeApi;
import com.mogo.eagle.core.function.v2x.events.entity.net.V2XOptimalRouteDataRes;
@@ -53,7 +57,17 @@ public class V2XOptimalRouteVREventScenario
if (entity != null) {
V2XOptimalRouteDataRes content = entity.getContent();
if (content != null) {
CallerHmiManager.INSTANCE.showWarningV2X(entity.getType() + "", "为您推荐最优路线", "已为您选择最优路线", TAG, this, !entity.isOnlyShow(), TimeUnit.SECONDS.toMillis(30));
CallerMsgBoxManager.INSTANCE.saveMsgBox(
new MsgBoxBean(
MsgBoxType.V2X,
new V2XMsg(entity.getType() + "",
"为您推荐最优路线",
"已为您选择最优路线")
)
);
CallerHmiManager.INSTANCE.warningV2X(entity.getType() + "",
"为您推荐最优路线", "已为您选择最优路线", TAG,
this, !entity.isOnlyShow(), TimeUnit.SECONDS.toMillis(30));
}
}
}

View File

@@ -10,9 +10,13 @@ import androidx.annotation.Nullable;
import com.mogo.eagle.core.data.enums.WarningDirectionEnum;
import com.mogo.eagle.core.data.map.MogoLocation;
import com.mogo.eagle.core.data.map.entity.V2XMessageEntity;
import com.mogo.eagle.core.data.msgbox.MsgBoxBean;
import com.mogo.eagle.core.data.msgbox.MsgBoxType;
import com.mogo.eagle.core.data.msgbox.V2XMsg;
import com.mogo.eagle.core.function.api.hmi.warning.IMoGoWarningStatusListener;
import com.mogo.eagle.core.function.api.map.listener.IMoGoMapLocationListener;
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager;
import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxManager;
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
import com.mogo.eagle.core.function.v2x.events.scenario.impl.AbsV2XScenario;
import com.mogo.eagle.core.function.v2x.events.scenario.view.IV2XMarker;
@@ -59,7 +63,18 @@ public class V2XFrontWarningScenario extends AbsV2XScenario implements IMoGoMapL
int v2xType = getV2XTypeForFrontWarning(mMarkerEntity);
V2XMessageEntity entity = getV2XMessageEntity();
if (v2xType != 0) {
CallerHmiManager.INSTANCE.showWarningV2X(v2xType + "", getAlertContentForFrontWarning(mMarkerEntity), mMarkerEntity.getTts(), TAG, this, !entity.isOnlyShow(), TimeUnit.SECONDS.toMillis(3));
CallerMsgBoxManager.INSTANCE.saveMsgBox(
new MsgBoxBean(
MsgBoxType.V2X,
new V2XMsg(v2xType + "",
getAlertContentForFrontWarning(mMarkerEntity).toString(),
mMarkerEntity.getTts())
)
);
CallerHmiManager.INSTANCE.warningV2X(v2xType + "",
getAlertContentForFrontWarning(mMarkerEntity), mMarkerEntity.getTts(),
TAG, this, !entity.isOnlyShow(),
TimeUnit.SECONDS.toMillis(3));
}
}
}

View File

@@ -20,6 +20,10 @@ import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_V2X
import com.mogo.eagle.core.utilcode.util.ThreadUtils
import com.mogo.eagle.core.data.enums.EventTypeEnum
import com.mogo.eagle.core.data.msgbox.MsgBoxBean
import com.mogo.eagle.core.data.msgbox.MsgBoxType
import com.mogo.eagle.core.data.msgbox.V2XMsg
import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxManager
import com.zhjt.service_biz.BizConfig
import kotlin.math.abs
import kotlin.math.ceil
@@ -200,7 +204,15 @@ class RedLightWarningManager : IMoGoTrafficLightListener, IMoGoVipSetListener,
private fun redLightWarning() {
CallerLogger.d("$M_V2X$TAG", "=====闯红灯预警=====")
ThreadUtils.runOnUiThread {
CallerHmiManager.showWarningV2X(
CallerMsgBoxManager.saveMsgBox(
MsgBoxBean(
MsgBoxType.V2X,
V2XMsg(EventTypeEnum.TYPE_USECASE_ID_IVP.poiType,
EventTypeEnum.TYPE_USECASE_ID_IVP.content,
EventTypeEnum.TYPE_USECASE_ID_IVP.tts)
)
)
CallerHmiManager.warningV2X(
EventTypeEnum.TYPE_USECASE_ID_IVP.poiType,
EventTypeEnum.TYPE_USECASE_ID_IVP.content,
EventTypeEnum.TYPE_USECASE_ID_IVP.tts,
@@ -227,7 +239,15 @@ class RedLightWarningManager : IMoGoTrafficLightListener, IMoGoVipSetListener,
EventTypeEnum.getWarningTts(EventTypeEnum.TYPE_USECASE_ID_IVP_GREEN.poiType),
speed
)
CallerHmiManager.showWarningV2X(
CallerMsgBoxManager.saveMsgBox(
MsgBoxBean(
MsgBoxType.V2X,
V2XMsg(EventTypeEnum.TYPE_USECASE_ID_IVP_GREEN.poiType,
content,
tts)
)
)
CallerHmiManager.warningV2X(
EventTypeEnum.TYPE_USECASE_ID_IVP_GREEN.poiType,
content,
tts,

View File

@@ -26,6 +26,10 @@ import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_
import com.mogo.eagle.core.utilcode.util.ToastUtils
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
import com.mogo.eagle.core.data.enums.EventTypeEnum
import com.mogo.eagle.core.data.msgbox.MsgBoxBean
import com.mogo.eagle.core.data.msgbox.MsgBoxType
import com.mogo.eagle.core.data.msgbox.V2XMsg
import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxManager
import com.zhjt.service_biz.BizConfig
class VipCarManager : IMogoOnMessageListener<VipMessage>, IMoGoTrafficLightListener,
@@ -241,7 +245,15 @@ class VipCarManager : IMogoOnMessageListener<VipMessage>, IMoGoTrafficLightListe
ttsContent: String,
tag: String
) {
CallerHmiManager.showWarningV2X(
CallerMsgBoxManager.saveMsgBox(
MsgBoxBean(
MsgBoxType.V2X,
V2XMsg(v2xType,
alertContent.toString(),
ttsContent)
)
)
CallerHmiManager.warningV2X(
v2xType, alertContent, ttsContent, tag,
object : IMoGoWarningStatusListener {
override fun onShow() {}

View File

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

View File

@@ -146,13 +146,13 @@ enum class EventTypeEnumNew(
content = "前车碰撞预警",
tts = "小心前车"
),
TYPE_USECASE_ID_ICW(
1.toString(),
"交叉路口碰撞预警",
poiTypeSrcVr = R.drawable.icon_warning_v2x_collision_warning,
content = "交叉路口碰撞预警",
tts = "注意交叉路口车辆"
),
// TYPE_USECASE_ID_ICW(
// 1.toString(),
// "交叉路口碰撞预警",
// poiTypeSrcVr = R.drawable.icon_warning_v2x_collision_warning,
// content = "交叉路口碰撞预警",
// tts = "注意交叉路口车辆"
// ),
TYPE_USECASE_ID_AVW(
7.toString(),
"异常车辆提醒",
@@ -218,21 +218,6 @@ enum class EventTypeEnumNew(
tts = "前方路口左转急弯,减速慢行",
),
//TODO
TYPE_USECASE_ID_VRUCW_PERSON(
0X2B0201.toString(),
"弱势交通参与者碰撞预警",
poiTypeSrcVr = R.drawable.icon_warning_v2x_pedestrian_crossing,
content = "注意行人",
tts = "注意行人"
),//行人/摩托车碰撞预警
TYPE_USECASE_ID_VRUCW_MOTORBIKE(
0X2B0202.toString(),
"弱势交通参与者碰撞预警",
poiTypeSrcVr = R.drawable.icon_warning_v2x_motorcycle_collision,
content = "注意摩托车",
tts = "注意摩托车"
),//摩托车碰撞预警
TYPE_USECASE_ID_LTA(
2.toString(),
"左转辅助",
@@ -241,13 +226,6 @@ enum class EventTypeEnumNew(
tts = "注意路口对向来车"
),
TYPE_USECASE_ID_IVS(
3.toString(),
"车内标牌",
poiTypeSrcVr = R.drawable.icon_warning_v2x_road_construction,
content = "车内标牌",
tts = ""
),
TYPE_USECASE_ID_TJW( //TODO
4.toString(),
"前方拥堵提醒",
@@ -256,32 +234,16 @@ enum class EventTypeEnumNew(
tts = "前方拥堵,减速慢行"
),
//TODO 不能使用之前obu的定义 ObuConstants.USE_CASE_ID.HLW.toString(),
TYPE_USECASE_OPTIMAL_LANE(
"111",
"最优车道",
poiTypeSrcVr = R.drawable.v2x_icon_live_logo,
content = "最优车道",
tts = "最优车道"
),
TYPE_USECASE_ID_HLW(
1.toString(),
"道路危险情况预警",
poiTypeSrcVr = R.drawable.icon_warning_v2x_road_dangerous,
content = "道路危险情况预警",
tts = "前方路况危险,小心行驶"
),//(如果能给出具体的类别,则播报具体危险类别)
TYPE_USECASE_ID_IVP(
0x2.toString(),
0x1.toString(),
"闯红灯预警",
poiTypeSrcVr = R.drawable.icon_warning_v2x_traffic_lights_red,
content = "路口红灯,禁止通行",
tts = "路口红灯,禁止通行"
),
TYPE_USECASE_ID_IVP_GREEN(
0x2B091.toString(),
0x2.toString(),
"绿波通行",
poiTypeSrcVr = R.drawable.icon_warning_v2x_traffic_lights_green,
content = "建议车速 %s KM/H",
@@ -305,22 +267,6 @@ enum class EventTypeEnumNew(
tts = "注意超速车辆"
),
TYPE_USECASE_ID_BREAKDOWN_WARNING(
101.toString(),
"注意故障车辆",
poiTypeSrcVr = R.drawable.icon_warning_v2x_collision_warning,
content = "注意故障车辆",
tts = "注意故障车辆"
),
TYPE_USECASE_ID_ROAD_PARKING(
412.toString(),
"注意异常停车",
poiTypeSrcVr = R.drawable.icon_warning_v2x_no_parking,
content = "注意异常停车",
tts = "注意异常停车"
),
TYPE_USECASE_ID_ROAD_TRAMCAR(
0x2C01.toString(),
"前方有轨电车提醒",
@@ -336,41 +282,6 @@ enum class EventTypeEnumNew(
content = "注意前方人行横道",
tts = "前方人行横道,减速慢行"
),
TYPE_USECASE_ID_ROAD_PEDESTRIAN_SCHOOL(
0x2C05.toString(),
"学校",
poiTypeSrcVr = R.drawable.icon_warning_v2x_school,
content = "注意前方学校",
tts = "前方学校,减速慢行"
),
TYPE_USECASE_ID_ROAD_COLLISION_WARNING(
0x2C06.toString(),
"事故易发路段",
poiTypeSrcVr = R.drawable.icon_warning_v2x_collision_warning,
content = "注意当前路段事故多发",
tts = "当前路段事故多发,请小心驾驶"
),
TYPE_USECASE_ID_ROAD_ROUNDABOUTPNG(
0x2C07.toString(),
"环岛行驶",
poiTypeSrcVr = R.drawable.icon_warning_v2x_roundaboutpng,
content = "注意前方驶入环岛",
tts = "即将驶入环岛,减速慢行"
),
TYPE_USECASE_ID_ROAD_TEST_SECTION(
0x2C08.toString(),
"驾校考试路段",
poiTypeSrcVr = R.drawable.icon_warning_v2x_test_section,
content = "注意前方驾校考试路段",
tts = "驾校考试路段,请小心驾驶"
),
TYPE_USECASE_ID_ROAD_HUMP_BRIDGE(
0x2C09.toString(),
"驼峰桥",
poiTypeSrcVr = R.drawable.icon_warning_v2x_hump_bridge,
content = "注意前方驼峰桥",
tts = "注意即将驶入驼峰桥,请小心驾驶"
),
TYPE_USECASE_ID_ROAD_NO_PARKING(
0x2C10.toString(),
"禁止停车",
@@ -740,32 +651,22 @@ enum class EventTypeEnumNew(
return when (poiType) {
TYPE_USECASE_ID_EBW.poiType -> TYPE_USECASE_ID_EBW.poiTypeSrcVr
TYPE_USECASE_ID_FCW.poiType -> TYPE_USECASE_ID_FCW.poiTypeSrcVr
TYPE_USECASE_ID_ICW.poiType -> TYPE_USECASE_ID_ICW.poiTypeSrcVr
// TYPE_USECASE_ID_ICW.poiType -> TYPE_USECASE_ID_ICW.poiTypeSrcVr
TYPE_USECASE_ID_CLW.poiType -> TYPE_USECASE_ID_CLW.poiTypeSrcVr
TYPE_USECASE_ID_DNPW.poiType -> TYPE_USECASE_ID_DNPW.poiTypeSrcVr
TYPE_USECASE_ID_AVW.poiType -> TYPE_USECASE_ID_AVW.poiTypeSrcVr
TYPE_USECASE_ID_BSW.poiType -> TYPE_USECASE_ID_BSW.poiTypeSrcVr
TYPE_USECASE_ID_LCW.poiType -> TYPE_USECASE_ID_LCW.poiTypeSrcVr
TYPE_USECASE_ID_EVW.poiType -> TYPE_USECASE_ID_EVW.poiTypeSrcVr
TYPE_USECASE_ID_VRUCW_PERSON.poiType -> TYPE_USECASE_ID_VRUCW_PERSON.poiTypeSrcVr
TYPE_USECASE_ID_VRUCW_MOTORBIKE.poiType -> TYPE_USECASE_ID_VRUCW_MOTORBIKE.poiTypeSrcVr
TYPE_USECASE_ID_SLW.poiType -> TYPE_USECASE_ID_SLW.poiTypeSrcVr
TYPE_USECASE_ID_LTA.poiType -> TYPE_USECASE_ID_LTA.poiTypeSrcVr
// TYPE_USECASE_ID_HLW.poiType -> TYPE_USECASE_ID_HLW.poiTypeSrcVr
TYPE_USECASE_ID_IVS.poiType -> TYPE_USECASE_ID_IVS.poiTypeSrcVr
TYPE_USECASE_ID_TJW.poiType -> TYPE_USECASE_ID_TJW.poiTypeSrcVr
TYPE_USECASE_ID_IVP.poiType -> TYPE_USECASE_ID_IVP.poiTypeSrcVr
TYPE_USECASE_ID_IVP_GREEN.poiType -> TYPE_USECASE_ID_IVP_GREEN.poiTypeSrcVr
// TYPE_USECASE_ID_COC.poiType -> TYPE_USECASE_ID_COC.poiTypeSrcVr
TYPE_USECASE_ID_ROAD_TRAMCAR.poiType -> TYPE_USECASE_ID_ROAD_TRAMCAR.poiTypeSrcVr
TYPE_USECASE_ID_ROAD_TURN_LEFT_SHARP.poiType -> TYPE_USECASE_ID_ROAD_TURN_LEFT_SHARP.poiTypeSrcVr
TYPE_USECASE_ID_ROAD_TURN_RIGHT_SHARP.poiType -> TYPE_USECASE_ID_ROAD_TURN_RIGHT_SHARP.poiTypeSrcVr
TYPE_USECASE_ID_ROAD_PEDESTRIAN_CROSSING.poiType -> TYPE_USECASE_ID_ROAD_PEDESTRIAN_CROSSING.poiTypeSrcVr
TYPE_USECASE_ID_ROAD_PEDESTRIAN_SCHOOL.poiType -> TYPE_USECASE_ID_ROAD_PEDESTRIAN_SCHOOL.poiTypeSrcVr
TYPE_USECASE_ID_ROAD_COLLISION_WARNING.poiType -> TYPE_USECASE_ID_ROAD_COLLISION_WARNING.poiTypeSrcVr
TYPE_USECASE_ID_ROAD_ROUNDABOUTPNG.poiType -> TYPE_USECASE_ID_ROAD_ROUNDABOUTPNG.poiTypeSrcVr
TYPE_USECASE_ID_ROAD_TEST_SECTION.poiType -> TYPE_USECASE_ID_ROAD_TEST_SECTION.poiTypeSrcVr
TYPE_USECASE_ID_ROAD_HUMP_BRIDGE.poiType -> TYPE_USECASE_ID_ROAD_HUMP_BRIDGE.poiTypeSrcVr
TYPE_USECASE_ID_ROAD_NO_PARKING.poiType -> TYPE_USECASE_ID_ROAD_NO_PARKING.poiTypeSrcVr
TYPE_USECASE_ID_ROAD_GIVE_WAY.poiType -> TYPE_USECASE_ID_ROAD_GIVE_WAY.poiTypeSrcVr
TYPE_VIP_IDENTIFICATION.poiType -> TYPE_VIP_IDENTIFICATION.poiTypeSrcVr
@@ -782,32 +683,22 @@ enum class EventTypeEnumNew(
return when (poiType) {
TYPE_USECASE_ID_EBW.poiType -> TYPE_USECASE_ID_EBW.content
TYPE_USECASE_ID_FCW.poiType -> TYPE_USECASE_ID_FCW.content
TYPE_USECASE_ID_ICW.poiType -> TYPE_USECASE_ID_ICW.content
// TYPE_USECASE_ID_ICW.poiType -> TYPE_USECASE_ID_ICW.content
TYPE_USECASE_ID_CLW.poiType -> TYPE_USECASE_ID_CLW.content
TYPE_USECASE_ID_DNPW.poiType -> TYPE_USECASE_ID_DNPW.content
TYPE_USECASE_ID_AVW.poiType -> TYPE_USECASE_ID_AVW.content
TYPE_USECASE_ID_BSW.poiType -> TYPE_USECASE_ID_BSW.content
TYPE_USECASE_ID_LCW.poiType -> TYPE_USECASE_ID_LCW.content
TYPE_USECASE_ID_EVW.poiType -> TYPE_USECASE_ID_EVW.content
TYPE_USECASE_ID_VRUCW_PERSON.poiType -> TYPE_USECASE_ID_VRUCW_PERSON.content
TYPE_USECASE_ID_VRUCW_MOTORBIKE.poiType -> TYPE_USECASE_ID_VRUCW_MOTORBIKE.content
TYPE_USECASE_ID_SLW.poiType -> TYPE_USECASE_ID_SLW.content
TYPE_USECASE_ID_LTA.poiType -> TYPE_USECASE_ID_LTA.content
// TYPE_USECASE_ID_HLW.poiType -> TYPE_USECASE_ID_HLW.content
TYPE_USECASE_ID_IVS.poiType -> TYPE_USECASE_ID_IVS.content
TYPE_USECASE_ID_TJW.poiType -> TYPE_USECASE_ID_TJW.content
TYPE_USECASE_ID_IVP.poiType -> TYPE_USECASE_ID_IVP.content
TYPE_USECASE_ID_IVP_GREEN.poiType -> TYPE_USECASE_ID_IVP_GREEN.content
// TYPE_USECASE_ID_COC.poiType -> TYPE_USECASE_ID_COC.content
TYPE_USECASE_ID_ROAD_TRAMCAR.poiType -> TYPE_USECASE_ID_ROAD_TRAMCAR.content
TYPE_USECASE_ID_ROAD_TURN_LEFT_SHARP.poiType -> TYPE_USECASE_ID_ROAD_TURN_LEFT_SHARP.content
TYPE_USECASE_ID_ROAD_TURN_RIGHT_SHARP.poiType -> TYPE_USECASE_ID_ROAD_TURN_RIGHT_SHARP.content
TYPE_USECASE_ID_ROAD_PEDESTRIAN_CROSSING.poiType -> TYPE_USECASE_ID_ROAD_PEDESTRIAN_CROSSING.content
TYPE_USECASE_ID_ROAD_PEDESTRIAN_SCHOOL.poiType -> TYPE_USECASE_ID_ROAD_PEDESTRIAN_SCHOOL.content
TYPE_USECASE_ID_ROAD_COLLISION_WARNING.poiType -> TYPE_USECASE_ID_ROAD_COLLISION_WARNING.content
TYPE_USECASE_ID_ROAD_ROUNDABOUTPNG.poiType -> TYPE_USECASE_ID_ROAD_ROUNDABOUTPNG.content
TYPE_USECASE_ID_ROAD_TEST_SECTION.poiType -> TYPE_USECASE_ID_ROAD_TEST_SECTION.content
TYPE_USECASE_ID_ROAD_HUMP_BRIDGE.poiType -> TYPE_USECASE_ID_ROAD_HUMP_BRIDGE.content
TYPE_USECASE_ID_ROAD_NO_PARKING.poiType -> TYPE_USECASE_ID_ROAD_NO_PARKING.content
TYPE_USECASE_ID_ROAD_GIVE_WAY.poiType -> TYPE_USECASE_ID_ROAD_GIVE_WAY.content
TYPE_VIP_IDENTIFICATION.poiType -> TYPE_VIP_IDENTIFICATION.content
@@ -825,32 +716,22 @@ enum class EventTypeEnumNew(
return when (poiType) {
TYPE_USECASE_ID_EBW.poiType -> TYPE_USECASE_ID_EBW.tts
TYPE_USECASE_ID_FCW.poiType -> TYPE_USECASE_ID_FCW.tts
TYPE_USECASE_ID_ICW.poiType -> TYPE_USECASE_ID_ICW.tts
// TYPE_USECASE_ID_ICW.poiType -> TYPE_USECASE_ID_ICW.tts
TYPE_USECASE_ID_CLW.poiType -> TYPE_USECASE_ID_CLW.tts
TYPE_USECASE_ID_DNPW.poiType -> TYPE_USECASE_ID_DNPW.tts
TYPE_USECASE_ID_AVW.poiType -> TYPE_USECASE_ID_AVW.tts
TYPE_USECASE_ID_BSW.poiType -> TYPE_USECASE_ID_BSW.tts
TYPE_USECASE_ID_LCW.poiType -> TYPE_USECASE_ID_LCW.tts
TYPE_USECASE_ID_EVW.poiType -> TYPE_USECASE_ID_EVW.tts
TYPE_USECASE_ID_VRUCW_PERSON.poiType -> TYPE_USECASE_ID_VRUCW_PERSON.tts
TYPE_USECASE_ID_VRUCW_MOTORBIKE.poiType -> TYPE_USECASE_ID_VRUCW_MOTORBIKE.tts
TYPE_USECASE_ID_SLW.poiType -> TYPE_USECASE_ID_SLW.tts
TYPE_USECASE_ID_LTA.poiType -> TYPE_USECASE_ID_LTA.tts
// TYPE_USECASE_ID_HLW.poiType -> TYPE_USECASE_ID_HLW.tts //TODO
TYPE_USECASE_ID_IVS.poiType -> TYPE_USECASE_ID_IVS.tts
TYPE_USECASE_ID_TJW.poiType -> TYPE_USECASE_ID_TJW.tts
TYPE_USECASE_ID_IVP.poiType -> TYPE_USECASE_ID_IVP.tts
TYPE_USECASE_ID_IVP_GREEN.poiType -> TYPE_USECASE_ID_IVP_GREEN.tts
// TYPE_USECASE_ID_COC.poiType -> TYPE_USECASE_ID_COC.tts
TYPE_USECASE_ID_ROAD_TRAMCAR.poiType -> TYPE_USECASE_ID_ROAD_TRAMCAR.tts
TYPE_USECASE_ID_ROAD_TURN_LEFT_SHARP.poiType -> TYPE_USECASE_ID_ROAD_TURN_LEFT_SHARP.tts
TYPE_USECASE_ID_ROAD_TURN_RIGHT_SHARP.poiType -> TYPE_USECASE_ID_ROAD_TURN_RIGHT_SHARP.tts
TYPE_USECASE_ID_ROAD_PEDESTRIAN_CROSSING.poiType -> TYPE_USECASE_ID_ROAD_PEDESTRIAN_CROSSING.tts
TYPE_USECASE_ID_ROAD_PEDESTRIAN_SCHOOL.poiType -> TYPE_USECASE_ID_ROAD_PEDESTRIAN_SCHOOL.tts
TYPE_USECASE_ID_ROAD_COLLISION_WARNING.poiType -> TYPE_USECASE_ID_ROAD_COLLISION_WARNING.tts
TYPE_USECASE_ID_ROAD_ROUNDABOUTPNG.poiType -> TYPE_USECASE_ID_ROAD_ROUNDABOUTPNG.tts
TYPE_USECASE_ID_ROAD_TEST_SECTION.poiType -> TYPE_USECASE_ID_ROAD_TEST_SECTION.tts
TYPE_USECASE_ID_ROAD_HUMP_BRIDGE.poiType -> TYPE_USECASE_ID_ROAD_HUMP_BRIDGE.tts
TYPE_USECASE_ID_ROAD_NO_PARKING.poiType -> TYPE_USECASE_ID_ROAD_NO_PARKING.tts
TYPE_USECASE_ID_ROAD_GIVE_WAY.poiType -> TYPE_USECASE_ID_ROAD_GIVE_WAY.tts
TYPE_VIP_IDENTIFICATION.poiType -> TYPE_VIP_IDENTIFICATION.tts

View File

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

View File

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

View File

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

View File

@@ -1,3 +1,6 @@
package com.mogo.eagle.core.data.msgbox
data class MsgBoxBean(val type: MsgBoxType, val bean: Any, var timestamp: Long = 0)
data class MsgBoxBean(val type: MsgBoxType, val bean: Any) {
var timestamp: Long = 0
var bean2Json: String = ""
}

View File

@@ -0,0 +1,3 @@
package com.mogo.eagle.core.data.msgbox
data class RecordBagMsg(var key: Long, var stat: Int, var id: Int, var type: Int, var fileName: String, var note: String)

View File

@@ -0,0 +1,3 @@
package com.mogo.eagle.core.data.msgbox
data class V2XMsg(var type: String = "", var content: String? = "", var tts: String? = "")

View File

@@ -99,6 +99,11 @@ interface IMoGoWaringProvider : IMoGoHmiViewProxy {
*/
fun showWarningV2X(v2xType: String, alertContent: CharSequence?, ttsContent: String?, tag: String?, listener: IMoGoWarningStatusListener?, playTts: Boolean, expireTime: Long)
/**
* 不展示顶部弹窗,其它保留
*/
fun warningV2X(v2xType: String, alertContent: CharSequence?, ttsContent: String?, tag: String?, listener: IMoGoWarningStatusListener?, playTts: Boolean, expireTime: Long)
/**
* 关闭指定floatTag 的 VR下V2X预警弹窗
* @param tag 弹窗标识

View File

@@ -1,5 +1,6 @@
package com.mogo.eagle.core.function.api.msgbox
import android.content.Context
import com.mogo.eagle.core.data.msgbox.MsgBoxBean
import com.mogo.eagle.core.function.api.base.IMoGoFunctionServerProvider
@@ -7,16 +8,20 @@ interface IMsgBoxProvider: IMoGoFunctionServerProvider {
fun saveMsg(bean: MsgBoxBean)
/**
* 通知消息V2X、云公告、运营信息
* 获取本地数据库缓存的通知消息V2X、云公告、运营信息
*/
fun getNotifyData(): List<MsgBoxBean>
fun getCachedNotifyData(): List<MsgBoxBean>
/**
* 工控机Report信息
* 获取本地数据库缓存的工控机Report信息
*/
fun getSysInfoData(): List<MsgBoxBean>
fun getCachedSysInfoData(): List<MsgBoxBean>
/**
* 录包信息
* 获取本地数据库缓存的录包信息
*/
fun getRecordBagData(): List<MsgBoxBean>
fun getCachedRecordBagData(): List<MsgBoxBean>
fun removeRecordInfo(context: Context, msgBoxBean: MsgBoxBean, key: String)
fun getDismissTime(): Long
}

View File

@@ -147,7 +147,6 @@ object CallerDevaToolsManager {
fun downLoadPackage(downloadKey: String, downloadUrl: String) {
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.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")
}

View File

@@ -9,6 +9,9 @@ import com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig.Companion.BIZ_SLW
import com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig.Companion.V2I
import com.mogo.eagle.core.data.enums.WarningDirectionEnum
import com.mogo.eagle.core.data.map.Infrastructure
import com.mogo.eagle.core.data.msgbox.MsgBoxBean
import com.mogo.eagle.core.data.msgbox.MsgBoxType
import com.mogo.eagle.core.data.msgbox.V2XMsg
import com.mogo.eagle.core.data.notice.NoticeNormalData
import com.mogo.eagle.core.data.notice.NoticeTrafficStylePushData
import com.mogo.eagle.core.data.report.ReportEntity
@@ -19,6 +22,7 @@ import com.mogo.eagle.core.function.api.hmi.view.IViewTrafficLight
import com.mogo.eagle.core.function.api.hmi.warning.IMoGoWaringProvider
import com.mogo.eagle.core.function.api.hmi.warning.IMoGoWarningStatusListener
import com.mogo.eagle.core.function.call.base.CallerBase
import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxManager.saveMsgBox
import com.zhjt.service_biz.BizConfig
/**
@@ -145,6 +149,29 @@ object CallerHmiManager : CallerBase() {
)
}
/**
* 不展示顶部弹窗,其它保留
*/
fun warningV2X(
v2xType: String,
alertContent: CharSequence?,
ttsContent: String?,
tag: String?,
listenerIMoGo: IMoGoWarningStatusListener?,
playTts: Boolean,
expireTime: Long = 5000L,
) {
waringProviderApi?.warningV2X(
v2xType,
alertContent,
ttsContent,
tag,
listenerIMoGo,
playTts,
expireTime
)
}
/**
* 关闭指定floatTag 的 VR下V2X预警弹窗
* @param tag 弹窗标识

View File

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

View File

@@ -1,5 +1,6 @@
package com.mogo.eagle.core.function.call.msgbox
import android.content.Context
import com.mogo.eagle.core.data.constants.MogoServicePaths
import com.mogo.eagle.core.data.msgbox.MsgBoxBean
import com.mogo.eagle.core.function.api.msgbox.IMsgBoxProvider
@@ -25,21 +26,33 @@ object CallerMsgBoxManager {
/**
* 通知消息V2X、云公告、运营信息
*/
fun getNotifyData(): List<MsgBoxBean>? {
return providerApi?.getNotifyData()
fun getCachedNotifyData(): List<MsgBoxBean>? {
return providerApi?.getCachedNotifyData()
}
/**
* 工控机Report信息
*/
fun getSysInfoData(): List<MsgBoxBean>? {
return providerApi?.getSysInfoData()
fun getCachedSysInfoData(): List<MsgBoxBean>? {
return providerApi?.getCachedSysInfoData()
}
/**
* 录包信息
*/
fun getRecordBagData(): List<MsgBoxBean>? {
return providerApi?.getRecordBagData()
fun getCachedRecordBagData(): List<MsgBoxBean>? {
return providerApi?.getCachedRecordBagData()
}
/**
* 用户已处理的Bag包需要删除(上传或取消都包含)
* key: Bag包的唯一标识key, msgBoxBean: UI展示的那个对象而不是重新new的
*/
fun removeRecordInfo(context: Context, msgBoxBean: MsgBoxBean, key: String) {
providerApi?.removeRecordInfo(context, msgBoxBean, key)
}
fun getDismissTime(): Long {
return providerApi?.getDismissTime() ?: 0L
}
}

View File

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

View File

@@ -45,7 +45,6 @@ dependencies {
implementation rootProject.ext.dependencies.amapnavi3dmap
if (Boolean.valueOf(USE_MAVEN_PACKAGE)) {
implementation rootProject.ext.dependencies.mogo_core_utils
api rootProject.ext.dependencies.mogoaicloudservicesdk
api rootProject.ext.dependencies.ttsbase
@@ -53,7 +52,6 @@ dependencies {
implementation rootProject.ext.dependencies.mogo_core_utils
api rootProject.ext.dependencies.mogo_core_network
} else {
implementation project(':core:mogo-core-utils')
api project(":foudations:mogo-aicloud-services-sdk")
api project(":tts:tts-base")

View File

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

View File

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

View File

@@ -55,12 +55,6 @@ dependencies {
api rootProject.ext.dependencies.mogoaicloudrealtime
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'
if (Boolean.valueOf(USE_MAVEN_PACKAGE)) {