Merge branch 'dev/dev_eagle_architecture_upgrade' into dev/dev_eagle_check

# Conflicts:
#	app/build.gradle
#	app/src/main/java/com/mogo/launcher/MogoApplication.java
#	gradle.properties
#	modules/mogo-module-extensions/src/main/java/com/mogo/module/extensions/entrance/EntranceFragment.java
#	modules/mogo-module-service/src/main/java/com/mogo/module/service/status/EnvStatusManager.java
#	services/mogo-service-api/src/main/java/com/mogo/service/IMogoServiceApis.java
#	services/mogo-service-api/src/main/java/com/mogo/service/MogoServicePaths.java
#	services/mogo-service/src/main/java/com/mogo/service/impl/MogoServiceApis.java
This commit is contained in:
liujing
2021-09-15 18:09:27 +08:00
1270 changed files with 23741 additions and 379701 deletions

View File

@@ -8,32 +8,23 @@ import android.os.Handler;
import android.os.Message;
import android.os.SystemClock;
import android.util.ArrayMap;
import android.util.Log;
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
import com.mogo.cloud.commons.utils.CoordinateUtils;
import com.mogo.commons.debug.DebugConfig;
import com.mogo.commons.voice.AIAssist;
import com.mogo.map.location.MogoLocation;
import com.mogo.module.common.MogoApisHandler;
import com.mogo.module.common.drawer.AdasRecognizedResultDrawer;
import com.mogo.module.common.entity.V2XMessageEntity;
import com.mogo.module.common.entity.V2XObuEventEntity;
import com.mogo.module.common.entity.V2XPushMessageEntity;
import com.mogo.module.service.MarkerServiceHandler;
import com.mogo.module.service.receiver.MogoReceiver;
import com.mogo.module.v2x.listener.V2XLocationListener;
import com.mogo.module.v2x.scenario.scene.obu.V2XObuEventScenario;
import com.mogo.module.v2x.utils.ADASUtils;
import com.mogo.module.v2x.utils.DrivingDirectionUtils;
import com.mogo.module.v2x.utils.ObuConfig;
import com.mogo.module.v2x.utils.TestOnLineCarUtils;
import com.mogo.module.v2x.utils.ToastUtils;
import com.mogo.module.v2x.utils.V2XUtils;
import com.mogo.service.adas.entity.ADASRecognizedResult;
import com.mogo.service.entrance.IMogoEntranceButtonController;
import com.mogo.utils.UiThreadHandler;
import com.mogo.utils.logger.Logger;
import com.zhidao.mogo.module.obu.ObuConstant;
import com.zhidao.mogo.module.obu.ObuManager;
@@ -41,33 +32,22 @@ import com.zhidao.mogo.module.obu.obu.IObuCallback;
import com.zhidao.mogo.module.obu.obu.bean.MogoObuEventInfo;
import com.zhidao.mogo.module.obu.obu.bean.MogoObuLocationInfo;
import com.zhidao.mogo.module.obu.obu.bean.MogoObuTrafficLightInfo;
//import com.zhidao.support.nebulaobu.NebulaObuClient;
//import com.zhidao.support.nebulaobu.OnObuListener;
//import com.zhidao.support.nebulaobu.model.ActiveSafetyInfo;
//import com.zhidao.support.nebulaobu.model.ObuInfo;
//import com.zhidao.support.nebulaobu.model.ObuInfoMore;
import com.zhidao.support.obu.MogoObuManager;
import com.zhidao.support.obu.OnMogoObuListener;
import com.zhidao.support.obu.constants.ObuConstants;
import com.zhidao.support.obu.model.CvxAppInitIndInfo;
import com.zhidao.support.obu.model.CvxHvCarIndInfo;
import com.zhidao.support.obu.model.CvxHvInfoIndInfo;
import com.zhidao.support.obu.model.CvxRvInfoIndInfo;
import com.zhidao.support.obu.model.CvxSetConfigCfmInfo;
import com.zhidao.support.obu.model.CvxV2vThreatIndInfo;
import org.json.JSONArray;
import org.json.JSONObject;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import static com.mogo.module.v2x.V2XConst.MODULE_NAME;
import static com.mogo.module.v2x.V2XServiceManager.getContext;
import static com.mogo.module.v2x.scenario.scene.obu.V2XObuEventScenario.ACTION_LAUNCHER_ADAS_APP_BIZ;
//import com.zhidao.support.nebulaobu.NebulaObuClient;
//import com.zhidao.support.nebulaobu.OnObuListener;
//import com.zhidao.support.nebulaobu.model.ActiveSafetyInfo;
//import com.zhidao.support.nebulaobu.model.ObuInfo;
//import com.zhidao.support.nebulaobu.model.ObuInfoMore;
/**
* obu数据管理类封装
*
@@ -113,153 +93,10 @@ public class V2XObuManager implements IObuCallback, Handler.Callback {
// NebulaObuClient.getInstance().registerObu(100);
// NebulaObuClient.getInstance().registerObuListener(listener);
//自研obu
MogoObuManager.getInstance().init(context);
MogoObuManager.getInstance().connect();
MogoObuManager.getInstance().registerListener(mogoObuListener);
//TODO 测试
// MogoObuManager.getInstance().test(icw_data);
// UiThreadHandler.postDelayed( () -> {
// MarkerServiceHandler.getApis().getV2XListenerManager().warningChangedForListenerWithDirection(3, MogoReceiver.ACTION_V2X_FRONT_WARNING);
// handleSdkObu(1);
//
// }, 5_000L );
IntentFilter filter = new IntentFilter("com.mogo.launcher.v2x.action.EXCHANGE_OBU_TYPE");
context.registerReceiver(obuTypeExchangeReceiver, filter);
}
private OnMogoObuListener mogoObuListener = new OnMogoObuListener() {
@Override
public void onConnected() {
//OBU连接成功
Logger.d("liyz", "onConnected ------> ");
}
@Override
public void onConnectFail(boolean isNeedReconnect) {
Logger.d("liyz", "onConnectFail ------> ");
//OBU连接失败
}
@Override
public void onDisconnect() {
Logger.d("liyz", "onDisconnect ------> ");
//OBU断开连接
}
@Override
public void onReceiveOriginData(String data) {
super.onReceiveOriginData(data);
Logger.d("liyz", "onReceiveOriginData ------> data = " + data);
//接收到的原始数据
}
@Override
public void onSendData(byte[] bytes) {
super.onSendData(bytes);
//发送的数据
Logger.d("liyz", "onSendData ------> ");
}
@Override
public void onCvxAppInitIndInfo(CvxAppInitIndInfo info) {
super.onCvxAppInitIndInfo(info);
Logger.d("liyz", "onCvxAppInitIndInfo ------> " + info.toString());
//CV2X系统信息
}
@Override
public void onCvxSetConfigCfm(CvxSetConfigCfmInfo info) {
super.onCvxSetConfigCfm(info);
Logger.d("liyz", "onCvxSetConfigCfm ------> " + info.toString());
//设置CV2X系统的配置确认
}
@Override
public void onCvxHvCarIndInfo(CvxHvCarIndInfo info) {
//主车车辆信息
Logger.d("liyz", "onCvxHvCarIndInfo ------> " + info.toString());
}
@Override
public void onCvxHvInfoIndInfo(CvxHvInfoIndInfo info) {
//主车信息
}
@Override
public void onCvxRvInfoIndInfo(CvxRvInfoIndInfo info) {
//远车信息
Logger.d("liyz", "onCvxRvInfoIndInfo ------> " + info.toString());
}
@Override
public void onCvxV2vThreatIndInfo(CvxV2vThreatIndInfo info) {
//预警信息
Logger.e("liyz", "onCvxV2vThreatIndInfo ------> " + info.toString());
//预警类型 threat_level 3
if (info != null) {
if (info.getThreat_info() != null && info.getControl() != null &&
info.getThreat_info().getThreat_level() == 3) { //看看2的情况
//预警方位
int direction = V2XUtils.getDirection((float) info.getExt_info().getAzimuth());
Log.d("liyz", "direction = " + direction + "---azimuth = " + (float) info.getExt_info().getAzimuth());
MarkerServiceHandler.getApis().getV2XListenerManager().warningChangedForListenerWithDirection(direction, MogoReceiver.ACTION_V2X_FRONT_WARNING);
//处理预警类型
int appId = info.getThreat_info().getApp_id();
handleSdkObu(getEventType(appId));
}
//预警数据的组装,车辆实时移动和变色 TODO 这里需要obu提供他车列表
AdasRecognizedResultDrawer.getInstance().renderAdasRecognizedResult(getResultList(info));
} else {
Log.e("liyz", "info == null ");
}
}
};
private int getEventType(int appid) {
if (appid == ObuConstants.USE_CASE_ID.EBW) {
return ObuConstant.TYPE_URGENCY_COLLISION_WARNING;
} else if (appid == ObuConstants.USE_CASE_ID.ICW) {
return ObuConstant.TYPE_CROSS_COLLISION_WARNING;
}
return 0;
}
private List<ADASRecognizedResult> resultList = null;
private List<ADASRecognizedResult> getResultList(CvxV2vThreatIndInfo info) {
if (resultList == null) {
resultList = new ArrayList<>();
}
ADASRecognizedResult adasRecognizedResult = new ADASRecognizedResult();
adasRecognizedResult.uuid = info.getVehicle_id();
if (info.getBasic_info() != null && info.getBasic_info().getPosition() != null) {
adasRecognizedResult.lat = info.getBasic_info().getPosition().getLatitude();
adasRecognizedResult.lon = info.getBasic_info().getPosition().getLongitude();
}
adasRecognizedResult.type = 3; //小轿车
adasRecognizedResult.heading = info.getBasic_info().getHeading();
adasRecognizedResult.speed = info.getBasic_info().getSpeed();
resultList.add(adasRecognizedResult);
return resultList;
}
// public void release() {
// NebulaObuClient.getInstance().unregisterObu();
// NebulaObuClient.getInstance().unregisterObuListener();
// MogoObuManager.getInstance().unregisterListener();
// }
/**
* 星云obu数据监听
*/
@@ -306,7 +143,7 @@ public class V2XObuManager implements IObuCallback, Handler.Callback {
} else if (type == ObuConstant.TYPE_URGENCY_COLLISION_WARNING) { // 前车紧急制动预警
urgencyEvent.setType(ObuConstant.TYPE_URGENCY_COLLISION_WARNING);
urgencyEvent.setDesc(V2XObuEventScenario.URGENCY_COLLISION_WARN_TEXT);
} else {
} else { //TODO
// urgencyEvent.setType(ObuConstant.TYPE_URGENCY_COLLISION_WARNING);
// urgencyEvent.setDesc(V2XObuEventScenario.URGENCY_COLLISION_WARN_TEXT);
}

View File

@@ -21,7 +21,7 @@ import com.mogo.service.IMogoServiceApis;
import com.mogo.service.MogoServicePaths;
import com.mogo.service.adas.IMogoADASController;
import com.mogo.service.analytics.IMogoAnalytics;
import com.mogo.service.connection.IMogoSocketManager;
import com.mogo.service.cloud.socket.IMogoSocketManager;
import com.mogo.service.entrance.IMogoEntranceButtonController;
import com.mogo.service.eventpanel.IEventPanelProvider;
import com.mogo.service.imageloader.IMogoImageloader;

View File

@@ -4,14 +4,13 @@ import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.RatingBar;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import com.alibaba.android.arouter.launcher.ARouter;
import com.mogo.module.common.enums.EventTypeEnum;
import com.mogo.module.common.view.CustomRatingBar;
import com.mogo.module.v2x.R;
import com.mogo.module.v2x.entity.panel.V2XShareEventDescription;
@@ -20,7 +19,6 @@ import com.mogo.module.v2x.entity.panel.V2XShareEventItemEnum;
import com.mogo.module.v2x.entity.panel.V2XShareEventLoadMoreItem;
import com.mogo.module.v2x.fragment.V2XEventPanelFragment;
import com.mogo.module.v2x.listener.AdapterCallback;
import com.mogo.module.v2x.utils.EventTypeUtils;
import com.mogo.service.IMogoServiceApis;
import com.mogo.service.MogoServicePaths;
import com.mogo.utils.DateTimeUtils;
@@ -108,8 +106,8 @@ public class V2XShareEventAdapter extends RecyclerView.Adapter<RecyclerView.View
String notLikeNum = String.valueOf(data.getNotlikeNum());
if (poitype != null) {
((shareItemViewHolder) holder).caseStyleTextView.setText(EventTypeUtils.getPoiTypeStr(poitype));
((shareItemViewHolder) holder).caseStyleTextView.setBackgroundResource(EventTypeUtils.getPoiTypeBgForShareItem(poitype));
((shareItemViewHolder) holder).caseStyleTextView.setText(EventTypeEnum.getPoiTypeStr(poitype));
((shareItemViewHolder) holder).caseStyleTextView.setBackgroundResource(EventTypeEnum.getPoiTypeBgForShareItem(poitype));
}
if (address != null) {

View File

@@ -10,14 +10,11 @@ import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import com.mogo.commons.voice.AIAssist;
import com.mogo.module.common.entity.MarkerPoiTypeEnum;
import com.mogo.module.common.entity.V2XPoiTypeEnum;
import com.mogo.module.common.enums.EventTypeEnum;
import com.mogo.module.v2x.R;
import com.mogo.module.v2x.adapter.holder.V2XSurroundingViewHolder;
import com.mogo.module.v2x.entity.panel.SurroundingConstruction;
import com.mogo.module.v2x.listener.SurroundingItemClickListener;
import com.mogo.module.v2x.utils.V2XUtils;
import java.util.List;
@@ -68,7 +65,7 @@ public class V2XSurroundingAdapter extends RecyclerView.Adapter<V2XSurroundingVi
mTypeTv = holder.itemView.findViewById(R.id.tv_poitype);
mTotalTv = holder.itemView.findViewById(R.id.tv_info_total);
mTypeTv.setText(getTypeName(surroundingConstruction.getPoiType()));
mTypeTv.setText(EventTypeEnum.getTypeName(surroundingConstruction.getPoiType()));
if (surroundingConstruction.getConstrutList() != null) {
mTotalTv.setText(surroundingConstruction.getConstrutList().size() + "");
}
@@ -77,13 +74,13 @@ public class V2XSurroundingAdapter extends RecyclerView.Adapter<V2XSurroundingVi
@Override
public void onClick(View v) {
if (mClickListener != null) {
mClickListener.onItemClickListener(v, position, surroundingConstruction);
mClickListener.onItemClickListener(v, holder.getAdapterPosition(), surroundingConstruction);
}
}
});
mBgImageView.setBackgroundResource(getTypeRes(surroundingConstruction.getPoiType()));
mTypeImageView.setBackgroundResource(getTypeSmallRes(surroundingConstruction.getPoiType()));
mBgImageView.setBackgroundResource(EventTypeEnum.getTypeRes(surroundingConstruction.getPoiType()));
mTypeImageView.setBackgroundResource(EventTypeEnum.getTypeSmallRes(surroundingConstruction.getPoiType()));
// RequestOptions requestOptions = new RequestOptions()
// .placeholder(R.drawable.v2x_icon_live_logo)
// .error(R.drawable.v2x_icon_live_logo)
@@ -105,132 +102,4 @@ public class V2XSurroundingAdapter extends RecyclerView.Adapter<V2XSurroundingVi
public int getItemCount() {
return mPoiInfosList == null ? 0 : mPoiInfosList.size();
}
private int getTypeSmallRes(String type) {
int resId = 0;
switch (type) {
case MarkerPoiTypeEnum.TRAFFIC_CHECK:
resId = R.drawable.mogo_image_jiaotongjiancha_small;
break;
case MarkerPoiTypeEnum.ROAD_CLOSED:
resId = R.drawable.mogo_image_fenglu_small;
break;
case MarkerPoiTypeEnum.FOURS_ROAD_WORK:
resId = R.drawable.mogo_image_daolushigong_small;
break;
case MarkerPoiTypeEnum.FOURS_BLOCK_UP:
resId = R.drawable.mogo_image_yongdu_small;
break;
case MarkerPoiTypeEnum.FOURS_PONDING:
resId = R.drawable.mogo_image_jishui_small;
break;
case MarkerPoiTypeEnum.FOURS_ICE:
resId = R.drawable.mogo_image_jiebing_small;
break;
case MarkerPoiTypeEnum.FOURS_FOG:
resId = R.drawable.mogo_image_nongwu_small;
break;
case MarkerPoiTypeEnum.FOURS_ACCIDENT:
case MarkerPoiTypeEnum.FOURS_ACCIDENT_01: // 重大事故
case MarkerPoiTypeEnum.FOURS_ACCIDENT_02: // 特大事故
case MarkerPoiTypeEnum.FOURS_ACCIDENT_03: // 较大事故
case MarkerPoiTypeEnum.FOURS_ACCIDENT_04: // 一般事故
case MarkerPoiTypeEnum.FOURS_ACCIDENT_05: // 轻微事故
resId = R.drawable.mogo_image_accident_small;
break;
case MarkerPoiTypeEnum.FOURS_LIVING:
resId = R.drawable.mogo_image_shishilukuang_small;
break;
default:
resId = R.drawable.mogo_image_shishilukuang_small;
break;
}
return resId;
}
private int getTypeRes(String type) {
int resId = 0;
switch (type) {
case MarkerPoiTypeEnum.TRAFFIC_CHECK:
resId = R.drawable.mogo_image_jiaotongjiancha_nor;
break;
case MarkerPoiTypeEnum.ROAD_CLOSED:
resId = R.drawable.mogo_image_fenglu_nor;
break;
case MarkerPoiTypeEnum.FOURS_ROAD_WORK:
resId = R.drawable.mogo_image_daolushigong_nor;
break;
case MarkerPoiTypeEnum.FOURS_BLOCK_UP:
resId = R.drawable.mogo_image_yongdu_nor;
break;
case MarkerPoiTypeEnum.FOURS_PONDING:
resId = R.drawable.mogo_image_jishui_nor;
break;
case MarkerPoiTypeEnum.FOURS_ICE:
resId = R.drawable.mogo_image_jiebing_nor;
break;
case MarkerPoiTypeEnum.FOURS_FOG:
resId = R.drawable.mogo_image_nongwu_nor;
break;
case MarkerPoiTypeEnum.FOURS_ACCIDENT:
case MarkerPoiTypeEnum.FOURS_ACCIDENT_01: // 重大事故
case MarkerPoiTypeEnum.FOURS_ACCIDENT_02: // 特大事故
case MarkerPoiTypeEnum.FOURS_ACCIDENT_03: // 较大事故
case MarkerPoiTypeEnum.FOURS_ACCIDENT_04: // 一般事故
case MarkerPoiTypeEnum.FOURS_ACCIDENT_05: // 轻微事故
resId = R.drawable.mogo_image_jiaotongshigu_nor;
break;
case MarkerPoiTypeEnum.FOURS_LIVING:
resId = R.drawable.mogo_image_shishlukuang_nor;
break;
default:
resId = R.drawable.mogo_image_shishlukuang_nor;
break;
}
return resId;
}
private String getTypeName(String type) {
String typeName = "";
switch (type) {
case MarkerPoiTypeEnum.ROAD_CLOSED:
typeName = "封路";
break;
case MarkerPoiTypeEnum.FOURS_ICE:
typeName = "道路结冰";
break;
case MarkerPoiTypeEnum.FOURS_FOG:
typeName = "浓雾";
break;
case MarkerPoiTypeEnum.TRAFFIC_CHECK:
typeName = "交通检查";
break;
case MarkerPoiTypeEnum.FOURS_ACCIDENT:
case MarkerPoiTypeEnum.FOURS_ACCIDENT_01: // 重大事故
case MarkerPoiTypeEnum.FOURS_ACCIDENT_02: // 特大事故
case MarkerPoiTypeEnum.FOURS_ACCIDENT_03: // 较大事故
case MarkerPoiTypeEnum.FOURS_ACCIDENT_04: // 一般事故
case MarkerPoiTypeEnum.FOURS_ACCIDENT_05: // 轻微事故
typeName = "交通事故";
break;
case MarkerPoiTypeEnum.FOURS_BLOCK_UP:
typeName = "拥堵";
break;
case MarkerPoiTypeEnum.FOURS_ROAD_WORK:
typeName = "施工";
break;
case MarkerPoiTypeEnum.FOURS_PONDING:
typeName = "道路积水";
break;
case MarkerPoiTypeEnum.FOURS_LIVING:
typeName = "实时路况";
break;
default:
typeName = "实时路况";
break;
}
return typeName;
}
}

View File

@@ -4,18 +4,16 @@ import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import com.mogo.module.common.entity.MarkerExploreWay;
import com.mogo.module.common.entity.MarkerPoiTypeEnum;
import com.mogo.module.common.enums.EventTypeEnum;
import com.mogo.module.v2x.R;
import com.mogo.module.v2x.V2XConst;
import com.mogo.module.v2x.adapter.holder.V2XSurroundingDetailVH;
import com.mogo.module.v2x.entity.panel.SurroundingConstruction;
import com.mogo.module.v2x.listener.SurroundingDetailItemListener;
import com.mogo.module.v2x.utils.RoadConditionUtils;
import com.mogo.module.v2x.view.HeartLikeView;
@@ -76,7 +74,7 @@ public class V2XSurroundingDetailAdapter extends RecyclerView.Adapter<V2XSurroun
mUnHeartLikeView = holder.itemView.findViewById(R.id.surrounding_road_unlike);
mUserNameTv.setText( exploreWay.getUserInfo() != null ? ("用户" + exploreWay.getUserInfo().getUserName() + "分享") : "蘑菇用户分享");
mTypeTv.setText(getTypeName(exploreWay.getPoiType()));
mTypeTv.setText(EventTypeEnum.getTypeName(exploreWay.getPoiType()));
mAddressTv.setText(exploreWay.getAddr());
mTimeTv.setText(DateTimeUtils.getTimeText(exploreWay.getGenerateTime(), DateTimeUtils.MM_Yue_dd_Ri_HH_mm));
@@ -134,50 +132,4 @@ public class V2XSurroundingDetailAdapter extends RecyclerView.Adapter<V2XSurroun
public int getItemCount() {
return markerExploreWays == null ? 0 : markerExploreWays.size();
}
private String getTypeName(String type) {
String typeName = "";
switch (type) {
case MarkerPoiTypeEnum.ROAD_CLOSED:
typeName = "封路";
break;
case MarkerPoiTypeEnum.FOURS_ICE:
typeName = "道路结冰";
break;
case MarkerPoiTypeEnum.FOURS_FOG:
typeName = "浓雾";
break;
case MarkerPoiTypeEnum.TRAFFIC_CHECK:
typeName = "交通检查";
break;
case MarkerPoiTypeEnum.FOURS_ACCIDENT:
case MarkerPoiTypeEnum.FOURS_ACCIDENT_01: // 重大事故
case MarkerPoiTypeEnum.FOURS_ACCIDENT_02: // 特大事故
case MarkerPoiTypeEnum.FOURS_ACCIDENT_03: // 较大事故
case MarkerPoiTypeEnum.FOURS_ACCIDENT_04: // 一般事故
case MarkerPoiTypeEnum.FOURS_ACCIDENT_05: // 轻微事故
typeName = "交通事故";
break;
case MarkerPoiTypeEnum.FOURS_BLOCK_UP:
typeName = "拥堵";
break;
case MarkerPoiTypeEnum.FOURS_ROAD_WORK:
typeName = "施工";
break;
case MarkerPoiTypeEnum.FOURS_PONDING:
typeName = "道路积水";
break;
case MarkerPoiTypeEnum.FOURS_LIVING:
typeName = "实时路况";
break;
default:
typeName = "实时路况";
break;
}
return typeName;
}
}

View File

@@ -13,11 +13,11 @@ import com.mogo.map.MogoLatLng;
import com.mogo.module.common.entity.MarkerExploreWay;
import com.mogo.module.common.entity.V2XEventShowEntity;
import com.mogo.module.common.entity.V2XRoadEventEntity;
import com.mogo.module.common.enums.EventTypeEnum;
import com.mogo.module.v2x.R;
import com.mogo.module.v2x.V2XConst;
import com.mogo.module.v2x.V2XServiceManager;
import com.mogo.module.v2x.scenario.view.IV2XWindow;
import com.mogo.module.v2x.utils.EventTypeUtils;
import com.mogo.module.v2x.utils.V2XUtils;
import com.mogo.module.v2x.voice.V2XVoiceCallbackListener;
import com.mogo.module.v2x.voice.V2XVoiceConstants;
@@ -116,7 +116,7 @@ public class V2XEventUgcVH extends V2XBaseViewHolder<V2XEventShowEntity> {
if (mNoveltyInfo != null) {
Object[] ugcTitleStr = EventTypeUtils.getUgcTitleStr(mNoveltyInfo.getPoiType());
Object[] ugcTitleStr = EventTypeEnum.getUgcTitleStr(mNoveltyInfo.getPoiType());
if (ugcTitleStr != null) {
tvEventUgcTitle.setText(((String) ugcTitleStr[0]).replace("####", mNoveltyInfo.getAddr()));

View File

@@ -2,13 +2,11 @@ package com.mogo.module.v2x.adapter.holder;
import android.content.Context;
import android.content.Intent;
import android.graphics.drawable.Drawable;
import android.os.Handler;
import android.text.TextUtils;
import android.util.Log;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
import android.view.WindowManager;
@@ -17,7 +15,6 @@ import android.widget.TextView;
import com.bumptech.glide.Glide;
import com.bumptech.glide.request.RequestOptions;
import com.mogo.commons.AbsMogoApplication;
import com.mogo.commons.debug.DebugConfig;
import com.mogo.module.common.animation.BezierAnimationView;
import com.mogo.module.common.entity.MarkerExploreWay;
@@ -25,8 +22,8 @@ import com.mogo.module.common.entity.MarkerUserInfo;
import com.mogo.module.common.entity.V2XEventShowEntity;
import com.mogo.module.common.entity.V2XLiveCarInfoEntity;
import com.mogo.module.common.entity.V2XMessageEntity;
import com.mogo.module.common.entity.V2XPoiTypeEnum;
import com.mogo.module.common.entity.V2XRoadEventEntity;
import com.mogo.module.common.enums.EventTypeEnum;
import com.mogo.module.common.wm.WindowManagerView;
import com.mogo.module.service.MarkerServiceHandler;
import com.mogo.module.service.receiver.MogoReceiver;
@@ -39,7 +36,6 @@ import com.mogo.module.v2x.scenario.scene.road.V2XRoadEventWindow;
import com.mogo.module.v2x.scenario.scene.road.V2XRoadVideoCarScenario;
import com.mogo.module.v2x.scenario.view.IV2XWindow;
import com.mogo.module.v2x.utils.ChartingUtil;
import com.mogo.module.v2x.utils.EventTypeUtils;
import com.mogo.module.v2x.utils.V2XSQLiteUtils;
import com.mogo.module.v2x.view.HeartLikeView;
import com.mogo.module.v2x.voice.V2XVoiceCallbackListener;
@@ -275,16 +271,17 @@ public class V2XRoadEventVH extends V2XBaseViewHolder<V2XEventShowEntity> {
.displayImage(mNoveltyInfo.getUserInfo().getUserHead(), ivReportHead);
}
String poiType = EventTypeUtils.getPoiTypeStr(mNoveltyInfo.getPoiType());
String poiType = EventTypeEnum.getPoiTypeStr(mNoveltyInfo.getPoiType());
if (!TextUtils.isEmpty(poiType)) {
tvEventTypeTitle.setText(poiType);
tvEventTypeTitle.setBackgroundResource(EventTypeUtils.getPoiTypeBg(mNoveltyInfo.getPoiType()));
tvEventTypeTitle.setBackgroundResource(EventTypeEnum.getPoiTypeBg(mNoveltyInfo.getPoiType(),
V2XServiceManager.getMoGoStatusManager().isVrMode()));
}
ivEvent.setImageResource(EventTypeUtils.getPoiTypeSrcVr(mNoveltyInfo.getPoiType()));
tvEvent.setText(EventTypeUtils.getPoiTypeStrVr(mNoveltyInfo.getPoiType()));
if (V2XPoiTypeEnum.FOURS_FOG.equals(mNoveltyInfo.getPoiType())) {
V2XServiceManager.getDisplayEffectsManager().displayEffects(V2XPoiTypeEnum.FOURS_FOG);
ivEvent.setImageResource(EventTypeEnum.getPoiTypeSrcVr(mNoveltyInfo.getPoiType()));
tvEvent.setText(EventTypeEnum.getPoiTypeStrVr(mNoveltyInfo.getPoiType()));
if (EventTypeEnum.FOURS_FOG.equals(mNoveltyInfo.getPoiType())) {
V2XServiceManager.getDisplayEffectsManager().displayEffects(EventTypeEnum.FOURS_FOG.getPoiType());
MarkerServiceHandler.getApis().getV2XListenerManager().warningChangedForListenerWithDirection(ALERT_THE_FRONT_CRASH_WARNING_TOP, MogoReceiver.ACTION_V2X_FRONT_WARNING);
}
tvEventAddress.setText(mNoveltyInfo.getAddr());

View File

@@ -8,9 +8,9 @@ import android.widget.TextView;
import com.mogo.module.common.entity.MarkerExploreWay;
import com.mogo.module.common.entity.V2XHistoryScenarioData;
import com.mogo.module.common.enums.EventTypeEnum;
import com.mogo.module.v2x.R;
import com.mogo.module.v2x.V2XConst;
import com.mogo.module.v2x.utils.EventTypeUtils;
import com.mogo.module.v2x.utils.RoadConditionUtils;
import com.mogo.module.v2x.utils.TimeUtils;
import com.mogo.module.v2x.utils.V2XSQLiteUtils;
@@ -58,7 +58,7 @@ public class V2XScenarioHistoryRoadEventVH extends V2XHistoryBaseViewHolder<V2XH
mIvIconP.setVisibility(View.GONE);
mTvAddress.setText(mExploreWay.getAddr());
mTagEventType.setText(EventTypeUtils.getPoiTypeStr(mExploreWay.getPoiType()));
mTagEventType.setText(EventTypeEnum.getPoiTypeStr(mExploreWay.getPoiType()));
try {
mTvIllegalNum.setText(mExploreWay.getUserInfo().getUserName() + "的分享 " +

View File

@@ -14,9 +14,9 @@ import com.mogo.map.search.poisearch.MogoPoiResult;
import com.mogo.map.search.poisearch.query.MogoPoiSearchQuery;
import com.mogo.module.common.entity.MarkerExploreWay;
import com.mogo.module.common.entity.MarkerLocation;
import com.mogo.module.common.entity.V2XPoiTypeEnum;
import com.mogo.module.common.entity.V2XPushMessageEntity;
import com.mogo.module.common.entity.V2XRoadEventEntity;
import com.mogo.module.common.enums.EventTypeEnum;
import com.mogo.module.service.Utils;
import com.mogo.module.v2x.V2XConst;
import com.mogo.module.v2x.V2XServiceManager;
@@ -187,7 +187,7 @@ public class V2XAlarmServer {
.getString(V2XConst.V2X_STRATEGY_PUSH), V2XStrategyPushRes.ResultBean.class);
V2XPushMessageEntity drivingShowEntity = new V2XPushMessageEntity();
drivingShowEntity.setSceneId(V2XPoiTypeEnum.ALERT_FATIGUE_DRIVING);
drivingShowEntity.setSceneId(EventTypeEnum.ALERT_FATIGUE_DRIVING.getPoiType());
if (strategyPushEntity != null &&
!ArrayUtils.isEmpty(strategyPushEntity.getLevelList())) {

View File

@@ -8,17 +8,14 @@ import com.mogo.map.location.MogoLocation;
import com.mogo.module.common.entity.MarkerLocation;
import com.mogo.module.common.entity.V2XMessageEntity;
import com.mogo.module.common.entity.V2XRoadEventEntity;
import com.mogo.module.common.enums.EventTypeEnum;
import com.mogo.module.v2x.V2XConst;
import com.mogo.module.v2x.utils.DrivingDirectionUtils;
import com.mogo.module.v2x.utils.EventTypeUtils;
import com.mogo.module.v2x.utils.V2XUtils;
import com.mogo.utils.logger.Logger;
import com.mogo.utils.network.utils.GsonUtil;
import java.util.ArrayList;
import java.util.Set;
import static com.mogo.module.v2x.V2XConst.MODULE_NAME;
/**
* V2X 道路预警服务
@@ -54,7 +51,7 @@ public class V2XEarlyWarningServer {
String roadInfoId = v2XRoadEventEntity.getNoveltyInfo().getInfoId();
// 封路、施工、拥堵、拥堵 才会有UGC提示
if (EventTypeUtils.isNeedRoadEventUgc(v2XRoadEventEntity.getPoiType())) {
if (EventTypeEnum.isNeedRoadEventUgc(v2XRoadEventEntity.getPoiType())) {
// Logger.w(MODULE_NAME,
// "V2X预警--UGC检测" +
// "\n事件详情" + roadInfoId +

View File

@@ -1,7 +1,7 @@
package com.mogo.module.v2x.entity.panel;
import com.mogo.module.common.entity.MarkerExploreWay;
import com.mogo.module.common.entity.MarkerPoiTypeEnum;
import com.mogo.module.common.enums.EventTypeEnum;
import java.io.Serializable;
import java.util.ArrayList;
@@ -39,43 +39,7 @@ public class SurroundingConstruction implements Serializable {
public String getTypeNameTTS(String type) {
String typeName = "请查看周边的";
switch (type) {
case MarkerPoiTypeEnum.ROAD_CLOSED:
typeName += "封路";
break;
case MarkerPoiTypeEnum.FOURS_ICE:
typeName += "道路结冰";
break;
case MarkerPoiTypeEnum.FOURS_FOG:
typeName += "浓雾";
break;
case MarkerPoiTypeEnum.TRAFFIC_CHECK:
typeName += "交通检查";
break;
case MarkerPoiTypeEnum.FOURS_ACCIDENT:
case MarkerPoiTypeEnum.FOURS_ACCIDENT_01: // 重大事故
case MarkerPoiTypeEnum.FOURS_ACCIDENT_02: // 特大事故
case MarkerPoiTypeEnum.FOURS_ACCIDENT_03: // 较大事故
case MarkerPoiTypeEnum.FOURS_ACCIDENT_04: // 一般事故
case MarkerPoiTypeEnum.FOURS_ACCIDENT_05: // 轻微事故
typeName += "交通事故";
break;
case MarkerPoiTypeEnum.FOURS_BLOCK_UP:
typeName += "拥堵";
break;
case MarkerPoiTypeEnum.FOURS_ROAD_WORK:
typeName += "施工";
break;
case MarkerPoiTypeEnum.FOURS_PONDING:
typeName += "道路积水";
break;
case MarkerPoiTypeEnum.FOURS_LIVING:
typeName += "实时路况";
break;
default:
typeName += "实时路况";
break;
}
typeName += EventTypeEnum.getTypeNameTTS(type);
return typeName + "信息";
}
}

View File

@@ -23,8 +23,8 @@ import com.google.android.material.tabs.TabLayoutMediator
import com.mogo.commons.debug.DebugConfig
import com.mogo.commons.mvp.MvpFragment
import com.mogo.module.common.entity.MarkerExploreWay
import com.mogo.module.common.entity.MarkerPoiTypeEnum
import com.mogo.module.common.MogoApisHandler
import com.mogo.module.common.enums.EventTypeEnum
import com.mogo.module.v2x.R
import com.mogo.module.common.view.SpacesItemDecoration
import com.mogo.module.v2x.V2XConst.MODULE_NAME
@@ -317,14 +317,14 @@ class V2XEventPanelFragment : MvpFragment<V2XEventPanelFragment, EventPanelPrese
mSurroundingDetailAdapter.notifyDataSetChanged()
val originStr = String.format(context!!.resources.getString(R.string.v2x_surrounding_detail_top_brief), markerExploreWays.size)
val spannableString = SpannableString(originStr + getTypeName(detailData.poiType))
val spannableString = SpannableString(originStr + EventTypeEnum.getTypeName(detailData.poiType))
spannableString.setSpan(ForegroundColorSpan(Color.parseColor("#459DFF")),
7, originStr.length - getTypeName(detailData.poiType)?.length!!, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE)
7, originStr.length - EventTypeEnum.getTypeName(detailData.poiType)?.length!!, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE)
//设置字体大小true表示前面的字体大小 dip
spannableString.setSpan(AbsoluteSizeSpan(context!!.resources.getDimension(R.dimen.module_v2x_surrounding_top_textsize).toInt(), true),
7, originStr.length - getTypeName(detailData.poiType)?.length!!, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE)
7, originStr.length - EventTypeEnum.getTypeName(detailData.poiType)?.length!!, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE)
spannableString.setSpan(StyleSpan(Typeface.BOLD), 7,
originStr.length - getTypeName(detailData.poiType)?.length!!, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE)
originStr.length - EventTypeEnum.getTypeName(detailData.poiType)?.length!!, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE)
mTopBriefTv?.text = (spannableString)
}
}
@@ -356,21 +356,6 @@ class V2XEventPanelFragment : MvpFragment<V2XEventPanelFragment, EventPanelPrese
}
}
private fun getTypeName(type: String): String? {
return when (type) {
MarkerPoiTypeEnum.ROAD_CLOSED -> "封路"
MarkerPoiTypeEnum.FOURS_ICE -> "道路结冰"
MarkerPoiTypeEnum.FOURS_FOG -> "浓雾"
MarkerPoiTypeEnum.TRAFFIC_CHECK -> "交通检查"
MarkerPoiTypeEnum.FOURS_ACCIDENT -> "交通事故"
MarkerPoiTypeEnum.FOURS_BLOCK_UP -> "拥堵"
MarkerPoiTypeEnum.FOURS_ROAD_WORK -> "施工"
MarkerPoiTypeEnum.FOURS_PONDING -> "道路积水"
MarkerPoiTypeEnum.FOURS_LIVING -> "实时路况"
else -> "实时路况"
}
}
/*
* 语音查询事件面板内容
* */

View File

@@ -128,6 +128,7 @@ public class V2XSurroundingFragment extends MvpFragment<SurroundingEventView, Su
@NonNull
@Override
protected SurroundingEventPresenter createPresenter() {
surroundingEventPresenter = new SurroundingEventPresenter(getContext(), this);
return surroundingEventPresenter;
}
@@ -135,7 +136,6 @@ public class V2XSurroundingFragment extends MvpFragment<SurroundingEventView, Su
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
EventBus.getDefault().register(this);
surroundingEventPresenter = new SurroundingEventPresenter(getContext(), this);
mApis = (IMogoServiceApis) ARouter.getInstance().build(MogoServicePaths.PATH_SERVICE_APIS).navigation(getContext());
}

View File

@@ -15,9 +15,9 @@ import com.mogo.map.search.geo.MogoRegeocodeResult;
import com.mogo.module.common.entity.MarkerExploreWay;
import com.mogo.module.common.entity.MarkerResponse;
import com.mogo.module.common.entity.V2XMessageEntity;
import com.mogo.module.common.entity.V2XPoiTypeEnum;
import com.mogo.module.common.entity.V2XPushMessageEntity;
import com.mogo.module.common.entity.V2XRoadEventEntity;
import com.mogo.module.common.enums.EventTypeEnum;
import com.mogo.module.service.Utils;
import com.mogo.module.v2x.V2XConst;
import com.mogo.module.v2x.V2XServiceManager;
@@ -37,12 +37,10 @@ import com.mogo.module.v2x.utils.V2XSQLiteUtils;
import com.mogo.utils.logger.Logger;
import com.mogo.utils.network.utils.GsonUtil;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import static com.mogo.module.common.entity.MarkerPoiTypeEnum.FOURS_BLOCK_UP;
import static com.mogo.module.v2x.V2XConst.MODULE_NAME;
/**
@@ -180,7 +178,7 @@ public class V2XLocationListener
Logger.i(V2XConst.MODULE_NAME, "疲劳驾驶POI查询结果为: " + GsonUtil.jsonFromObject(drivingShowEntity));
String style = V2XServiceManager.getMoGoStatusManager().isMainPageOnResume() ? "1" : "2";
trackWithType(V2XPoiTypeEnum.ALERT_FATIGUE_DRIVING, drivingShowEntity.getLon(), drivingShowEntity.getLat(), style);
trackWithType(EventTypeEnum.ALERT_FATIGUE_DRIVING.getPoiType(), drivingShowEntity.getLon(), drivingShowEntity.getLat(), style);
V2XMessageEntity<V2XPushMessageEntity> v2XMessageEntity = new V2XMessageEntity<>();
v2XMessageEntity.setType(V2XMessageEntity.V2XTypeEnum.ALERT_FATIGUE_DRIVING);
@@ -220,7 +218,7 @@ public class V2XLocationListener
//如果poiType是道路拥堵则调用接口查询拥堵状态
String poiType = v2XRoadEventEntity.getPoiType();
if (poiType != null && poiType.equals(FOURS_BLOCK_UP)) {
if (poiType != null && poiType.equals(EventTypeEnum.FOURS_BLOCK_UP.getPoiType())) {
V2XServiceManager.getIMogoTrafficUploadProvider().verifyCurrentTrafficStatus();
}
}

View File

@@ -8,9 +8,9 @@ import com.mogo.module.common.entity.MarkerExploreWay;
import com.mogo.module.common.entity.MarkerLocation;
import com.mogo.module.common.entity.MarkerOnlineCar;
import com.mogo.module.common.entity.MarkerShowEntity;
import com.mogo.module.common.enums.EventTypeEnum;
import com.mogo.module.service.ServiceConst;
import com.mogo.module.v2x.V2XServiceManager;
import com.mogo.module.common.entity.V2XPoiTypeEnum;
import com.mogo.module.common.entity.V2XRoadEventEntity;
import com.mogo.module.v2x.utils.ChartingUtil;
import com.mogo.utils.logger.Logger;
@@ -110,7 +110,7 @@ public class V2XMarkerClickListener implements IMogoMarkerClickListener {
V2XRoadEventEntity v2XRoadEventEntity = new V2XRoadEventEntity();
v2XRoadEventEntity.setLocation(markerExploreWay.getLocation());
// 探路目前只有上报拥堵
v2XRoadEventEntity.setPoiType(V2XPoiTypeEnum.FOURS_BLOCK_UP);
v2XRoadEventEntity.setPoiType(EventTypeEnum.FOURS_BLOCK_UP.getPoiType());
v2XRoadEventEntity.setDistance(1000);
v2XRoadEventEntity.setNoveltyInfo(markerExploreWay);

View File

@@ -7,7 +7,7 @@ import com.mogo.module.v2x.scenario.impl.V2XScenarioManager;
import com.mogo.module.v2x.utils.ADASUtils;
import com.mogo.module.v2x.utils.MarkerUtils;
import com.mogo.module.v2x.utils.V2XUtils;
import com.mogo.service.connection.IMogoOnMessageListener;
import com.mogo.service.cloud.socket.IMogoOnMessageListener;
import com.mogo.utils.TipToast;
import com.mogo.utils.logger.Logger;
import com.mogo.utils.network.utils.GsonUtil;

View File

@@ -1,7 +1,7 @@
package com.mogo.module.v2x.listener;
import com.mogo.module.common.entity.V2XMessageEntity;
import com.mogo.module.common.entity.V2XPoiTypeEnum;
import com.mogo.module.common.enums.EventTypeEnum;
import com.mogo.module.v2x.V2XConst;
import com.mogo.module.v2x.V2XServiceManager;
import com.mogo.module.v2x.entity.net.V2XSpecialCarRes;
@@ -9,7 +9,7 @@ import com.mogo.module.v2x.entity.net.V2XSpecialCarRes.V2XMarkerEntity;
import com.mogo.module.v2x.scenario.impl.V2XScenarioManager;
import com.mogo.module.v2x.utils.MarkerUtils;
import com.mogo.module.v2x.utils.V2XUtils;
import com.mogo.service.connection.IMogoOnMessageListener;
import com.mogo.service.cloud.socket.IMogoOnMessageListener;
import com.mogo.utils.logger.Logger;
import com.mogo.utils.network.utils.GsonUtil;
@@ -67,7 +67,7 @@ public class V2XMessageListener_401005 implements IMogoOnMessageListener<V2XSpec
for (V2XMarkerEntity coordinate : coordinates) {
//故障车机
if (coordinate.getTargetId() == V2XPoiTypeEnum.ALERT_CAR_TROUBLE_WARNING) {
if (EventTypeEnum.ALERT_CAR_TROUBLE_WARNING.getPoiType().equals(coordinate.getTargetId()+"")) {
entityList.add(coordinate);
}
}

View File

@@ -1,7 +1,7 @@
package com.mogo.module.v2x.listener;
import com.mogo.module.v2x.entity.net.V2XAlarmEventRes;
import com.mogo.service.connection.IMogoOnMessageListener;
import com.mogo.service.cloud.socket.IMogoOnMessageListener;
import com.mogo.utils.logger.Logger;
import static com.mogo.module.v2x.V2XConst.MODULE_NAME;

View File

@@ -1,11 +1,11 @@
package com.mogo.module.v2x.listener;
import com.mogo.module.common.enums.EventTypeEnum;
import com.mogo.module.service.MarkerServiceHandler;
import com.mogo.module.v2x.V2XServiceManager;
import com.mogo.module.v2x.entity.net.V2XAlarmEventRes;
import com.mogo.module.common.entity.V2XPoiTypeEnum;
import com.mogo.module.v2x.utils.ADASUtils;
import com.mogo.service.connection.IMogoOnMessageListener;
import com.mogo.service.cloud.socket.IMogoOnMessageListener;
import com.mogo.utils.logger.Logger;
import java.util.HashMap;
@@ -38,7 +38,7 @@ public class V2XMessageListener_401007 implements IMogoOnMessageListener<V2XAlar
// 统计代码
final Map<String, Object> properties = new HashMap<>();
properties.put("warning_id", V2XPoiTypeEnum.ALERT_TRAFFIC_CONTROL);
properties.put("warning_id", EventTypeEnum.ALERT_TRAFFIC_CONTROL.getPoiType());
MarkerServiceHandler.getMogoAnalytics().track("v2x_warning", properties);
}
} catch (Exception e) {

View File

@@ -4,7 +4,7 @@ import com.mogo.module.common.entity.V2XPushMessageEntity;
import com.mogo.module.v2x.V2XServiceManager;
import com.mogo.module.v2x.entity.net.V2XGiveLike;
import com.mogo.module.v2x.utils.ADASUtils;
import com.mogo.service.connection.IMogoOnMessageListener;
import com.mogo.service.cloud.socket.IMogoOnMessageListener;
import com.mogo.utils.TipToast;
import com.mogo.utils.logger.Logger;

View File

@@ -1,7 +1,7 @@
package com.mogo.module.v2x.listener;
import com.mogo.module.v2x.entity.net.V2XAlarmEventRes;
import com.mogo.service.connection.IMogoOnMessageListener;
import com.mogo.service.cloud.socket.IMogoOnMessageListener;
import com.mogo.utils.logger.Logger;
import static com.mogo.module.v2x.V2XConst.MODULE_NAME;

View File

@@ -4,11 +4,7 @@ import com.mogo.module.common.entity.MarkerCardResult;
import com.mogo.module.common.entity.MarkerResponse;
import com.mogo.module.v2x.V2XServiceManager;
import com.mogo.module.v2x.utils.V2XUtils;
import com.mogo.service.connection.IMogoOnMessageListener;
import com.mogo.utils.logger.Logger;
import com.mogo.utils.network.utils.GsonUtil;
import static com.mogo.module.v2x.V2XConst.MODULE_NAME;
import com.mogo.service.cloud.socket.IMogoOnMessageListener;
/**
* author : donghongyu

View File

@@ -19,7 +19,7 @@ import com.mogo.module.v2x.utils.TimeConstants;
import com.mogo.module.v2x.utils.TimeUtils;
import com.mogo.module.v2x.utils.TrackUtils;
import com.mogo.module.v2x.utils.V2XUtils;
import com.mogo.service.connection.IMogoOnMessageListener;
import com.mogo.service.cloud.socket.IMogoOnMessageListener;
import com.mogo.utils.logger.Logger;
import com.mogo.utils.network.utils.GsonUtil;

View File

@@ -8,10 +8,8 @@ import androidx.localbroadcastmanager.content.LocalBroadcastManager;
import com.mogo.module.common.entity.V2XMessageEntity;
import com.mogo.module.common.entity.V2XWarningEntity;
import com.mogo.module.v2x.V2XConst;
import com.mogo.module.v2x.V2XServiceManager;
import com.mogo.module.v2x.entity.net.V2XOptimalRouteDataRes;
import com.mogo.module.v2x.utils.V2XUtils;
import com.mogo.service.connection.IMogoOnMessageListener;
import com.mogo.service.cloud.socket.IMogoOnMessageListener;
/**
* desc: 车路云预警-弱势交通参与者

View File

@@ -8,7 +8,7 @@ import com.mogo.module.common.entity.V2XMessageEntity;
import com.mogo.module.v2x.V2XConst;
import com.mogo.module.v2x.entity.net.V2XOptimalRouteDataRes;
import com.mogo.module.v2x.utils.V2XUtils;
import com.mogo.service.connection.IMogoOnMessageListener;
import com.mogo.service.cloud.socket.IMogoOnMessageListener;
import com.mogo.utils.logger.Logger;
import com.mogo.utils.network.utils.GsonUtil;

View File

@@ -21,10 +21,9 @@ import com.mogo.module.common.entity.MarkerExploreWay;
import com.mogo.module.common.entity.MarkerLocation;
import com.mogo.module.common.entity.MarkerNoveltyInfo;
import com.mogo.module.common.entity.MarkerOnlineCar;
import com.mogo.module.common.entity.MarkerPoiTypeEnum;
import com.mogo.module.common.entity.MarkerShowEntity;
import com.mogo.module.common.entity.V2XPoiTypeEnum;
import com.mogo.module.common.entity.V2XRoadEventEntity;
import com.mogo.module.common.enums.EventTypeEnum;
import com.mogo.module.common.utils.CarSeries;
import com.mogo.module.service.ServiceConst;
import com.mogo.module.service.Utils;
@@ -35,7 +34,6 @@ import com.mogo.module.v2x.entity.net.V2XSpecialCarRes.V2XMarkerEntity;
import com.mogo.module.v2x.listener.V2XMarkerClickListener;
import com.mogo.module.v2x.manager.IMoGoV2XMarkerManager;
import com.mogo.module.v2x.marker.V2XMarkerAdapter;
import com.mogo.module.v2x.utils.EventTypeUtils;
import com.mogo.module.v2x.utils.MarkerUtils;
import com.mogo.utils.ViewUtils;
import com.mogo.utils.logger.Logger;
@@ -141,7 +139,7 @@ public class MoGoV2XMarkerManager implements IMoGoV2XMarkerManager {
if (exploreWayList != null) {
for (MarkerExploreWay markerExploreWay : exploreWayList) {
if (EventTypeUtils.isRoadEvent(markerExploreWay.getPoiType())) {
if (EventTypeEnum.isRoadEvent(markerExploreWay.getPoiType())) {
MarkerLocation markerLocation = markerExploreWay.getLocation();
// 记录道路事件
V2XRoadEventEntity v2XRoadEventEntity = new V2XRoadEventEntity();
@@ -290,7 +288,7 @@ public class MoGoV2XMarkerManager implements IMoGoV2XMarkerManager {
MogoMarkerOptions options = new MogoMarkerOptions().object(roadEventEntity)
.latitude(roadEventEntity.getLocation().getLat()).longitude(roadEventEntity.getLocation().getLon());
options.anchor(0.5f, 0.5f);
options.icon3DRes(com.mogo.module.common.R.raw.othercar);
options.icon3DRes(com.mogo.module.common.R.raw.special_vehicle);
options.anchorColor("#FFBF29FF");
m3DMarker = V2XServiceManager.getMarkerManager().addMarker(V2X_EVENT_ALARM_POI, options);
m3DMarker.setToTop();
@@ -415,26 +413,21 @@ public class MoGoV2XMarkerManager implements IMoGoV2XMarkerManager {
markerShowEntity.setTextContent(noveltyInfo.getLocation().getAddress());
// 这里只绘制道路事件相关
switch (noveltyInfo.getPoiType()) {
case V2XPoiTypeEnum.TRAFFIC_CHECK:
case V2XPoiTypeEnum.ROAD_CLOSED:
case V2XPoiTypeEnum.FOURS_ROAD_WORK:
case V2XPoiTypeEnum.FOURS_BLOCK_UP:
case V2XPoiTypeEnum.FOURS_PONDING:
case V2XPoiTypeEnum.FOURS_PARKING:
case V2XPoiTypeEnum.FOURS_ICE:
case V2XPoiTypeEnum.FOURS_FOG:
case V2XPoiTypeEnum.FOURS_ACCIDENT:
case MarkerPoiTypeEnum.FOURS_ACCIDENT_01: // 重大事故
case MarkerPoiTypeEnum.FOURS_ACCIDENT_02: // 特大事故
case MarkerPoiTypeEnum.FOURS_ACCIDENT_03: // 较大事故
case MarkerPoiTypeEnum.FOURS_ACCIDENT_04: // 一般事故
case MarkerPoiTypeEnum.FOURS_ACCIDENT_05: // 轻微事故
drawableMarker(
V2XServiceManager.getContext(),
markerShowEntity,
clickListener);
break;
if (EventTypeEnum.TRAFFIC_CHECK.getPoiType().equals(noveltyInfo.getPoiType())
|| EventTypeEnum.ROAD_CLOSED.getPoiType().equals(noveltyInfo.getPoiType())
|| EventTypeEnum.FOURS_ROAD_WORK.getPoiType().equals(noveltyInfo.getPoiType())
|| EventTypeEnum.FOURS_BLOCK_UP.getPoiType().equals(noveltyInfo.getPoiType())
|| EventTypeEnum.FOURS_PONDING.getPoiType().equals(noveltyInfo.getPoiType())
|| EventTypeEnum.FOURS_PARKING.getPoiType().equals(noveltyInfo.getPoiType())
|| EventTypeEnum.FOURS_ICE.getPoiType().equals(noveltyInfo.getPoiType())
|| EventTypeEnum.FOURS_FOG.getPoiType().equals(noveltyInfo.getPoiType())
|| EventTypeEnum.FOURS_ACCIDENT.getPoiType().equals(noveltyInfo.getPoiType())
|| EventTypeEnum.FOURS_ACCIDENT_01.getPoiType().equals(noveltyInfo.getPoiType())
|| EventTypeEnum.FOURS_ACCIDENT_02.getPoiType().equals(noveltyInfo.getPoiType())
|| EventTypeEnum.FOURS_ACCIDENT_03.getPoiType().equals(noveltyInfo.getPoiType())
|| EventTypeEnum.FOURS_ACCIDENT_04.getPoiType().equals(noveltyInfo.getPoiType())
|| EventTypeEnum.FOURS_ACCIDENT_05.getPoiType().equals(noveltyInfo.getPoiType())) {
drawableMarker(V2XServiceManager.getContext(), markerShowEntity, clickListener);
}
}
}

View File

@@ -6,8 +6,8 @@ import com.alibaba.android.arouter.facade.annotation.Route;
import com.mogo.map.MogoLatLng;
import com.mogo.map.overlay.IMogoPolyline;
import com.mogo.map.overlay.MogoPolylineOptions;
import com.mogo.module.common.entity.V2XPoiTypeEnum;
import com.mogo.module.common.entity.V2XRoadEventEntity;
import com.mogo.module.common.enums.EventTypeEnum;
import com.mogo.module.v2x.MoGoV2XServicePaths;
import com.mogo.module.v2x.V2XServiceManager;
import com.mogo.module.v2x.manager.IMoGoV2XPolylineManager;
@@ -44,20 +44,16 @@ public class MoGoV2XPolylineManager implements IMoGoV2XPolylineManager {
// 渐变色
List<Integer> colors = new ArrayList<>();
switch (roadEventEntity.getPoiType()) {
case V2XPoiTypeEnum.ALERT_TRAFFIC_LIGHT_SUGGEST:
case V2XPoiTypeEnum.ALERT_TRAFFIC_LIGHT_WARNING:
case V2XPoiTypeEnum.FOURS_BLOCK_UP:
case V2XPoiTypeEnum.ALERT_CAR_TROUBLE_WARNING + "":
colors.add(0xFFFFA31A);
colors.add(0xFFFFA31A);
break;
default:
colors.add(0xFFE32F46);
colors.add(0xFFE32F46);
break;
if (EventTypeEnum.ALERT_TRAFFIC_LIGHT_SUGGEST.getPoiType().equals(roadEventEntity.getPoiType())
|| EventTypeEnum.ALERT_TRAFFIC_LIGHT_WARNING.getPoiType().equals(roadEventEntity.getPoiType())
|| EventTypeEnum.FOURS_BLOCK_UP.getPoiType().equals(roadEventEntity.getPoiType())
|| EventTypeEnum.ALERT_CAR_TROUBLE_WARNING.getPoiType().equals(roadEventEntity.getPoiType())) {
colors.add(0xFFFFA31A);
colors.add(0xFFFFA31A);
} else {
colors.add(0xFFE32F46);
colors.add(0xFFE32F46);
}
// 线条粗细,渐变,渐变色值
options.width(10).useGradient(true).colorValues(colors);

View File

@@ -7,8 +7,6 @@ import com.alibaba.android.arouter.facade.annotation.Route;
import com.mogo.map.MogoLatLng;
import com.mogo.map.overlay.IMogoPolyline;
import com.mogo.map.overlay.MogoPolylineOptions;
import com.mogo.module.common.entity.V2XPoiTypeEnum;
import com.mogo.module.common.entity.V2XRoadEventEntity;
import com.mogo.module.v2x.MoGoV2XServicePaths;
import com.mogo.module.v2x.V2XConst;
import com.mogo.module.v2x.V2XServiceManager;

View File

@@ -3,7 +3,6 @@ package com.mogo.module.v2x.marker;
import android.content.Context;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.widget.ImageView;
import androidx.annotation.Nullable;

View File

@@ -4,11 +4,10 @@ import android.content.Context;
import android.graphics.Bitmap;
import com.mogo.module.common.entity.MarkerShowEntity;
import com.mogo.module.common.entity.V2XPoiTypeEnum;
import com.mogo.module.common.entity.V2XPushMessageEntity;
import com.mogo.module.common.entity.V2XRoadEventEntity;
import com.mogo.module.common.enums.EventTypeEnum;
import com.mogo.module.v2x.R;
import com.mogo.module.v2x.V2XServiceManager;
import com.mogo.module.v2x.utils.ImageUtil;
import com.mogo.module.v2x.utils.V2XUtils;
@@ -42,22 +41,19 @@ public class V2XMarkerAdapter {
*/
public static Bitmap getV2XRoadEventViewPng(Context context, V2XRoadEventEntity alarmInfo) {
Bitmap bitmap;
switch (alarmInfo.getPoiType()) {
case V2XPoiTypeEnum.ALERT_TRAFFIC_LIGHT_SUGGEST:
case V2XPoiTypeEnum.ALERT_TRAFFIC_LIGHT_WARNING:
case V2XPoiTypeEnum.FOURS_BLOCK_UP:
case V2XPoiTypeEnum.ALERT_CAR_TROUBLE_WARNING + "":
bitmap = getV2XRoadEventMarkerView(
context,
alarmInfo,
R.drawable.v_to_x_warning_circle_orange_00040);
break;
default:
bitmap = getV2XRoadEventMarkerView(
context,
alarmInfo,
R.drawable.v_to_x_warning_circle_red_00040);
break;
if (EventTypeEnum.ALERT_TRAFFIC_LIGHT_SUGGEST.getPoiType().equals(alarmInfo.getPoiType())
|| EventTypeEnum.ALERT_TRAFFIC_LIGHT_WARNING.getPoiType().equals(alarmInfo.getPoiType())
|| EventTypeEnum.FOURS_BLOCK_UP.getPoiType().equals(alarmInfo.getPoiType())
|| EventTypeEnum.ALERT_CAR_TROUBLE_WARNING.getPoiType().equals(alarmInfo.getPoiType())) {
bitmap = getV2XRoadEventMarkerView(
context,
alarmInfo,
R.drawable.v_to_x_warning_circle_orange_00040);
} else {
bitmap = getV2XRoadEventMarkerView(
context,
alarmInfo,
R.drawable.v_to_x_warning_circle_red_00040);
}
return bitmap;
}
@@ -67,16 +63,13 @@ public class V2XMarkerAdapter {
*/
public static ArrayList<Bitmap> getV2XRoadEventViewGif(Context context, V2XRoadEventEntity alarmInfo) {
ArrayList<Bitmap> bitmapArrayList;
switch (alarmInfo.getPoiType()) {
case V2XPoiTypeEnum.ALERT_TRAFFIC_LIGHT_SUGGEST:
case V2XPoiTypeEnum.ALERT_TRAFFIC_LIGHT_WARNING:
case V2XPoiTypeEnum.FOURS_BLOCK_UP:
case V2XPoiTypeEnum.ALERT_CAR_TROUBLE_WARNING + "":
bitmapArrayList = getV2XRoadEventOrangeMarkerView(context, alarmInfo);
break;
default:
bitmapArrayList = getV2XRoadEventRedMarkerView(context, alarmInfo);
break;
if (EventTypeEnum.ALERT_TRAFFIC_LIGHT_SUGGEST.getPoiType().equals(alarmInfo.getPoiType())
|| EventTypeEnum.ALERT_TRAFFIC_LIGHT_WARNING.getPoiType().equals(alarmInfo.getPoiType())
|| EventTypeEnum.FOURS_BLOCK_UP.getPoiType().equals(alarmInfo.getPoiType())
|| EventTypeEnum.ALERT_CAR_TROUBLE_WARNING.getPoiType().equals(alarmInfo.getPoiType())) {
bitmapArrayList = getV2XRoadEventOrangeMarkerView(context, alarmInfo);
} else {
bitmapArrayList = getV2XRoadEventRedMarkerView(context, alarmInfo);
}
return bitmapArrayList;
}
@@ -132,44 +125,44 @@ public class V2XMarkerAdapter {
*/
public static ArrayList<Bitmap> getV2XRoadEventOrangeMarkerView(Context context, V2XRoadEventEntity alarmInfo) {
ArrayList<Bitmap> icons = new ArrayList<>();
icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, R.drawable.v_to_x_warning_circle_orange_00011));
icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, R.drawable.v_to_x_warning_circle_orange_00012));
icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, R.drawable.v_to_x_warning_circle_orange_00013));
icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, R.drawable.v_to_x_warning_circle_orange_00014));
icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, R.drawable.v_to_x_warning_circle_orange_00015));
icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, R.drawable.v_to_x_warning_circle_orange_00016));
icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, R.drawable.v_to_x_warning_circle_orange_00017));
icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, R.drawable.v_to_x_warning_circle_orange_00018));
icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, R.drawable.v_to_x_warning_circle_orange_00019));
icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, R.drawable.v_to_x_warning_circle_orange_00020));
icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, R.drawable.v_to_x_warning_circle_orange_00021));
icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, R.drawable.v_to_x_warning_circle_orange_00022));
icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, R.drawable.v_to_x_warning_circle_orange_00023));
icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, R.drawable.v_to_x_warning_circle_orange_00024));
icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, R.drawable.v_to_x_warning_circle_orange_00025));
icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, R.drawable.v_to_x_warning_circle_orange_00026));
icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, R.drawable.v_to_x_warning_circle_orange_00027));
icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, R.drawable.v_to_x_warning_circle_orange_00028));
icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, R.drawable.v_to_x_warning_circle_orange_00029));
icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, R.drawable.v_to_x_warning_circle_orange_00030));
icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, R.drawable.v_to_x_warning_circle_orange_00031));
icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, R.drawable.v_to_x_warning_circle_orange_00032));
icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, R.drawable.v_to_x_warning_circle_orange_00033));
icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, R.drawable.v_to_x_warning_circle_orange_00034));
icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, R.drawable.v_to_x_warning_circle_orange_00035));
icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, R.drawable.v_to_x_warning_circle_orange_00036));
icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, R.drawable.v_to_x_warning_circle_orange_00037));
icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, R.drawable.v_to_x_warning_circle_orange_00038));
icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, R.drawable.v_to_x_warning_circle_orange_00039));
icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, R.drawable.v_to_x_warning_circle_orange_00040));
icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, R.drawable.v_to_x_warning_circle_orange_00041));
icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, R.drawable.v_to_x_warning_circle_orange_00042));
icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, R.drawable.v_to_x_warning_circle_orange_00043));
icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, R.drawable.v_to_x_warning_circle_orange_00044));
icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, R.drawable.v_to_x_warning_circle_orange_00045));
icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, R.drawable.v_to_x_warning_circle_orange_00046));
icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, R.drawable.v_to_x_warning_circle_orange_00047));
icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, R.drawable.v_to_x_warning_circle_orange_00048));
icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, R.drawable.v_to_x_warning_circle_orange_00011));
icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, R.drawable.v_to_x_warning_circle_orange_00012));
icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, R.drawable.v_to_x_warning_circle_orange_00013));
icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, R.drawable.v_to_x_warning_circle_orange_00014));
icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, R.drawable.v_to_x_warning_circle_orange_00015));
icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, R.drawable.v_to_x_warning_circle_orange_00016));
icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, R.drawable.v_to_x_warning_circle_orange_00017));
icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, R.drawable.v_to_x_warning_circle_orange_00018));
icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, R.drawable.v_to_x_warning_circle_orange_00019));
icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, R.drawable.v_to_x_warning_circle_orange_00020));
icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, R.drawable.v_to_x_warning_circle_orange_00021));
icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, R.drawable.v_to_x_warning_circle_orange_00022));
icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, R.drawable.v_to_x_warning_circle_orange_00023));
icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, R.drawable.v_to_x_warning_circle_orange_00024));
icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, R.drawable.v_to_x_warning_circle_orange_00025));
icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, R.drawable.v_to_x_warning_circle_orange_00026));
icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, R.drawable.v_to_x_warning_circle_orange_00027));
icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, R.drawable.v_to_x_warning_circle_orange_00028));
icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, R.drawable.v_to_x_warning_circle_orange_00029));
icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, R.drawable.v_to_x_warning_circle_orange_00030));
icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, R.drawable.v_to_x_warning_circle_orange_00031));
icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, R.drawable.v_to_x_warning_circle_orange_00032));
icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, R.drawable.v_to_x_warning_circle_orange_00033));
icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, R.drawable.v_to_x_warning_circle_orange_00034));
icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, R.drawable.v_to_x_warning_circle_orange_00035));
icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, R.drawable.v_to_x_warning_circle_orange_00036));
icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, R.drawable.v_to_x_warning_circle_orange_00037));
icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, R.drawable.v_to_x_warning_circle_orange_00038));
icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, R.drawable.v_to_x_warning_circle_orange_00039));
icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, R.drawable.v_to_x_warning_circle_orange_00040));
icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, R.drawable.v_to_x_warning_circle_orange_00041));
icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, R.drawable.v_to_x_warning_circle_orange_00042));
icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, R.drawable.v_to_x_warning_circle_orange_00043));
icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, R.drawable.v_to_x_warning_circle_orange_00044));
icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, R.drawable.v_to_x_warning_circle_orange_00045));
icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, R.drawable.v_to_x_warning_circle_orange_00046));
icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, R.drawable.v_to_x_warning_circle_orange_00047));
icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, R.drawable.v_to_x_warning_circle_orange_00048));
return icons;
}

View File

@@ -10,7 +10,6 @@ import com.mogo.module.common.entity.MarkerOnlineCar
import com.mogo.module.common.entity.MarkerShowEntity
import com.mogo.module.v2x.R
import com.mogo.module.v2x.entity.net.V2XSpecialCarRes.V2XMarkerEntity
import com.mogo.module.common.entity.V2XPoiTypeEnum
import com.mogo.utils.ViewUtils
import kotlinx.android.synthetic.main.view_marker_car.view.*
import kotlinx.android.synthetic.main.view_marker_car_info.view.*
@@ -130,7 +129,7 @@ class V2XMarkerCarInfoView(context: Context, showEntity: MarkerShowEntity) :
ivCar.setImageResource(R.drawable.v_to_x_warning_car_red)
}
// 故障车
V2XPoiTypeEnum.ALERT_CAR_TROUBLE_WARNING -> {
20007 -> {
clMarkerContent.visibility = View.GONE
ivReverseTriangle.visibility = View.GONE
ivCar.setImageResource(R.drawable.v_to_x_warning_car_red)

View File

@@ -9,7 +9,6 @@ import com.mogo.module.common.entity.MarkerOnlineCar
import com.mogo.module.common.entity.MarkerShowEntity
import com.mogo.module.v2x.R
import com.mogo.module.v2x.entity.net.V2XSpecialCarRes.V2XMarkerEntity
import com.mogo.module.common.entity.V2XPoiTypeEnum
import com.mogo.utils.ViewUtils
import kotlinx.android.synthetic.main.view_marker_car.view.*
@@ -101,7 +100,7 @@ class V2XMarkerCarView(context: Context, showEntity: MarkerShowEntity) :
ivCar.setImageResource(R.drawable.v_to_x_warning_car_red)
}
// 故障车
V2XPoiTypeEnum.ALERT_CAR_TROUBLE_WARNING -> {
20007 -> {
ivMarkerTip.visibility = View.GONE
ivCar.setImageResource(R.drawable.v_to_x_warning_car_red)
}

View File

@@ -4,13 +4,10 @@ package com.mogo.module.v2x.marker
import android.content.Context
import android.graphics.Bitmap
import android.view.LayoutInflater
import android.view.View
import androidx.constraintlayout.widget.ConstraintLayout
import com.mogo.module.common.entity.MarkerExploreWay
import com.mogo.module.common.entity.V2XPoiTypeEnum
import com.mogo.module.common.entity.V2XRoadEventEntity
import com.mogo.module.common.enums.EventTypeEnum
import com.mogo.module.v2x.R
import com.mogo.module.v2x.V2XServiceManager
import com.mogo.utils.ViewUtils
import kotlinx.android.synthetic.main.view_marker_event_car.view.*
@@ -33,8 +30,8 @@ class V2XMarkerRoadEventView(context: Context, alarmInfo: V2XRoadEventEntity) :
}
fun initView(context: Context, alarmInfo: V2XRoadEventEntity) {
if (alarmInfo.poiType == V2XPoiTypeEnum.ALERT_FRONT_CAR ||
alarmInfo.poiType == V2XPoiTypeEnum.ALERT_CAR_TROUBLE_WARNING.toString()
if (alarmInfo.poiType == EventTypeEnum.ALERT_FRONT_CAR.poiType ||
alarmInfo.poiType == EventTypeEnum.ALERT_CAR_TROUBLE_WARNING.poiType
) {
LayoutInflater.from(context)
.inflate(R.layout.view_marker_event_car, this)
@@ -46,72 +43,14 @@ class V2XMarkerRoadEventView(context: Context, alarmInfo: V2XRoadEventEntity) :
}
/**
* @see V2XPoiTypeEnum
* @see EventTypeEnum
*/
private fun updateIcon(alarmInfo: V2XRoadEventEntity) {
//Logger.d(MODULE_NAME, alarmInfo.toString())
// 道路施工、积水、路面结冰、浓雾、事故、拥堵
when (alarmInfo.poiType) {
//交通检查
V2XPoiTypeEnum.TRAFFIC_CHECK -> {
ivCar.setImageResource(R.drawable.v_to_x_marker_2)
}
//封路
V2XPoiTypeEnum.ROAD_CLOSED -> {
ivCar.setImageResource(R.drawable.v_to_x_marker_16)
}
//施工
V2XPoiTypeEnum.FOURS_ROAD_WORK -> {
ivCar.setImageResource(R.drawable.v_to_x_marker_11)
}
//拥堵
V2XPoiTypeEnum.FOURS_BLOCK_UP -> {
ivCar.setImageResource(R.drawable.v_to_x_marker_5)
}
//积水
V2XPoiTypeEnum.FOURS_PONDING -> {
ivCar.setImageResource(R.drawable.v_to_x_marker_6)
}
//浓雾
V2XPoiTypeEnum.FOURS_FOG -> {
ivCar.setImageResource(R.drawable.v_to_x_marker_9)
}
//结冰
V2XPoiTypeEnum.FOURS_ICE -> {
ivCar.setImageResource(R.drawable.v_to_x_marker_8)
}
//事故
V2XPoiTypeEnum.FOURS_ACCIDENT -> {
ivCar.setImageResource(R.drawable.v_to_x_marker_7)
}
//事故
V2XPoiTypeEnum.FOURS_LIVING -> {
ivCar.setImageResource(R.drawable.v_to_x_marker_1)
}
//红绿灯数据
V2XPoiTypeEnum.ALERT_TRAFFIC_LIGHT_SUGGEST -> {
ivCar.setImageResource(R.drawable.v_to_x_marker_3)
}
//红绿灯数据
V2XPoiTypeEnum.ALERT_TRAFFIC_LIGHT_WARNING -> {
ivCar.setImageResource(R.drawable.v_to_x_marker_3)
}
//前方静止or慢速车辆报警
V2XPoiTypeEnum.ALERT_FRONT_CAR -> {
ivCar.setImageResource(R.drawable.v_to_x_warning_car_red)
}
// 故障车辆
V2XPoiTypeEnum.ALERT_CAR_TROUBLE_WARNING.toString() -> {
ivCar.setImageResource(R.drawable.icon_car_red)
}
// 取快递
V2XPoiTypeEnum.ALERT_TRAFFIC_EXPRESS -> {
ivCar.setImageResource(R.drawable.v_to_x_marker_express)
}
// 顺风车
V2XPoiTypeEnum.ALERT_TRAFFIC_TAXI -> {
ivCar.setImageResource(R.drawable.v_to_x_marker_taxi)
}
val iconResId = EventTypeEnum.getUpdateIconRes(alarmInfo.poiType)
if (iconResId != 0) {
ivCar.setImageResource(iconResId)
}
}

View File

@@ -6,24 +6,21 @@ import android.text.TextUtils;
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
import com.alibaba.android.arouter.launcher.ARouter;
import com.mogo.cloud.passport.MoGoAiCloudClientConfig;
import com.mogo.commons.AbsMogoApplication;
import com.mogo.commons.data.BaseData;
import com.mogo.commons.network.ParamsProvider;
import com.mogo.commons.network.SubscribeImpl;
import com.mogo.commons.network.Utils;
import com.mogo.commons.voice.AIAssist;
import com.mogo.map.MogoLatLng;
import com.mogo.map.location.MogoLocation;
import com.mogo.map.search.geo.IMogoGeoSearchListener;
import com.mogo.map.search.geo.MogoGeocodeResult;
import com.mogo.map.search.geo.MogoRegeocodeResult;
import com.mogo.module.common.entity.MarkerResponse;
import com.mogo.module.common.entity.V2XMessageEntity;
import com.mogo.module.common.entity.V2XPoiTypeEnum;
import com.mogo.module.common.entity.V2XPushMessageEntity;
import com.mogo.module.common.entity.V2XRecommendRouteEntity;
import com.mogo.module.common.enums.EventTypeEnum;
import com.mogo.module.service.ServiceConst;
import com.mogo.module.service.network.RefreshBody;
import com.mogo.module.v2x.V2XConst;
@@ -39,8 +36,6 @@ import com.mogo.module.v2x.entity.net.V2XStrategyPushRes;
import com.mogo.module.v2x.entity.net.V2XUserInfoRes;
import com.mogo.module.v2x.utils.LocationUtils;
import com.mogo.module.v2x.utils.V2XUtils;
import com.mogo.service.MogoServicePaths;
import com.mogo.service.network.IMogoNetwork;
import com.mogo.utils.logger.Logger;
import com.mogo.utils.network.RequestOptions;
import com.mogo.utils.network.utils.GsonUtil;
@@ -48,12 +43,9 @@ import com.mogo.utils.network.utils.GsonUtil;
import java.util.Map;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.annotations.NonNull;
import io.reactivex.functions.Function;
import io.reactivex.schedulers.Schedulers;
import okhttp3.RequestBody;
import static com.mogo.module.v2x.V2XConst.MODULE_NAME;
import static com.mogo.module.v2x.V2XServiceManager.getContext;
@@ -704,7 +696,7 @@ public class V2XRefreshModel {
boolean isSendRecommendRoute = false;
if (v2XRoadDataRes.getResult().getPoiData() != null && v2XRoadDataRes.getResult().getPoiData().size() > 0) {
for (V2XRoadDataRes.ResultDTO.PoiDataDTO poiDataDTO : v2XRoadDataRes.getResult().getPoiData()) {
if (!V2XPoiTypeEnum.FOURS_LIVING.equals(poiDataDTO.getPoiType())) {
if (!EventTypeEnum.FOURS_LIVING.getPoiType().equals(poiDataDTO.getPoiType())) {
isSendRecommendRoute = true;
break;
}

View File

@@ -112,15 +112,21 @@ public class V2XObuEventScenario extends AbsV2XScenario<V2XObuEventEntity> imple
} else {
optimalSpeedMarker.clearPOI();
}
} else if (v2XMessageEntity.getContent().getType() == ObuConstant.TYPE_CROSS_COLLISION_WARNING) {
} else if (v2XMessageEntity.getContent().getType() == ObuConstant.TYPE_CROSS_COLLISION_WARNING && !isCrossWarning) {
AIAssist.getInstance(V2XServiceManager.getContext()).speakTTSVoice(URGENCY_CROING_WARN_TEXT);
} else if (v2XMessageEntity.getContent().getType() == ObuConstant.TYPE_URGENCY_COLLISION_WARNING) {
isCrossWarning = true;
} else if (v2XMessageEntity.getContent().getType() == ObuConstant.TYPE_URGENCY_COLLISION_WARNING && !isUrgenchyWarning) {
AIAssist.getInstance(V2XServiceManager.getContext()).speakTTSVoice(URGENCY_COLLISION_WARN_TEXT_ONE);
isUrgenchyWarning = true;
}
show();
}
private boolean isCrossWarning;
private boolean isUrgenchyWarning;
/**
* 展示场景
* <p>
@@ -298,6 +304,9 @@ public class V2XObuEventScenario extends AbsV2XScenario<V2XObuEventEntity> imple
if (msg.what == MSG_CLOSE_OBU_WINDOW) {
Logger.d(MODULE_NAME, "V2X Obu scenario expire===");
closeWindow();
isCrossWarning = false;
isUrgenchyWarning = false;
return true;
}
return false;

View File

@@ -66,7 +66,6 @@ public class V2XObuEventWindow extends FrameLayout implements IV2XWindow<V2XObuE
@Override
public void show(V2XObuEventEntity entity) {
Logger.d(MODULE_NAME, "ObuEventWindow show " + entity);
Logger.d("liyz", "ObuEventWindow show " + entity);
switch (entity.getType()) {
case ObuConstant
.TYPE_OPTIMAL_SPEED_ADVISORY:

View File

@@ -4,8 +4,8 @@ import androidx.annotation.Nullable;
import com.mogo.module.common.entity.MarkerExploreWay;
import com.mogo.module.common.entity.V2XMessageEntity;
import com.mogo.module.common.entity.V2XPoiTypeEnum;
import com.mogo.module.common.entity.V2XRoadEventEntity;
import com.mogo.module.common.enums.EventTypeEnum;
import com.mogo.module.v2x.V2XServiceManager;
import com.mogo.module.v2x.V2XStatusManager;
import com.mogo.module.v2x.alarm.V2XAlarmServer;
@@ -65,14 +65,14 @@ public class V2XIllegalParkScenario extends AbsV2XScenario<List<MarkerExploreWay
V2XRoadEventEntity v2XRoadEventEntity = new V2XRoadEventEntity();
v2XRoadEventEntity.setAlarmContent("违章停车");
v2XRoadEventEntity.setExpireTime(20000);
v2XRoadEventEntity.setPoiType(V2XPoiTypeEnum.ALERT_ILLEGAL_PARK);
v2XRoadEventEntity.setPoiType(EventTypeEnum.ALERT_ILLEGAL_PARK.getPoiType());
if (V2XServiceManager.getMoGoStatusManager().isMainPageOnResume()) {
v2XRoadEventEntity.setTts(markerExploreWay.getAddr() + "可能被罚违章停车,您可以说,有用或没用来帮助其它车友。");
((V2XIllegalParkWindow) getV2XWindow()).show(markerExploreWay, true);
TrackUtils.trackV2xRoadShow(markerExploreWay.getInfoId(), V2XPoiTypeEnum.ALERT_ILLEGAL_PARK, "1");
TrackUtils.trackV2xRoadShow(markerExploreWay.getInfoId(), EventTypeEnum.ALERT_ILLEGAL_PARK.getPoiType(), "1");
} else {
v2XRoadEventEntity.setTts(markerExploreWay.getAddr() + "可能被罚违章停车");
TrackUtils.trackV2xRoadShow(markerExploreWay.getInfoId(), V2XPoiTypeEnum.ALERT_ILLEGAL_PARK, "2");
TrackUtils.trackV2xRoadShow(markerExploreWay.getInfoId(), EventTypeEnum.ALERT_ILLEGAL_PARK.getPoiType(), "2");
}
ADASUtils.broadcastToADAS(V2XServiceManager.getContext(), v2XRoadEventEntity);
saveLocalStory(V2XMessageEntity.V2XTypeEnum.ALERT_ILLEGAL_PARK_WARNING,

View File

@@ -3,9 +3,9 @@ package com.mogo.module.v2x.scenario.scene.push;
import com.mogo.module.common.entity.MarkerExploreWay;
import com.mogo.module.common.entity.MarkerExploreWayItem;
import com.mogo.module.common.entity.MarkerLocation;
import com.mogo.module.common.entity.V2XPoiTypeEnum;
import com.mogo.module.common.entity.V2XPushMessageEntity;
import com.mogo.module.common.entity.V2XRoadEventEntity;
import com.mogo.module.common.enums.EventTypeEnum;
import com.mogo.module.v2x.V2XServiceManager;
import com.mogo.module.v2x.listener.V2XMarkerClickListener;
import com.mogo.module.v2x.scenario.view.IV2XMarker;
@@ -38,7 +38,7 @@ public class V2XPushEventMarker implements IV2XMarker<V2XPushMessageEntity> {
V2XRoadEventEntity v2XRoadEventEntity = new V2XRoadEventEntity();
v2XRoadEventEntity.setLocation(markerLocation);
// 探路目前只有上报拥堵
v2XRoadEventEntity.setPoiType(V2XPoiTypeEnum.ALERT_TRAFFIC_EXPRESS);
v2XRoadEventEntity.setPoiType(EventTypeEnum.ALERT_TRAFFIC_EXPRESS.getPoiType());
MarkerExploreWay markerNoveltyInfo = new MarkerExploreWay();
@@ -46,7 +46,7 @@ public class V2XPushEventMarker implements IV2XMarker<V2XPushMessageEntity> {
MarkerExploreWayItem exploreWayItem = new MarkerExploreWayItem();
exploreWayItem.setThumbnail(entity.getMsgImgUrl());
items.add(exploreWayItem);
markerNoveltyInfo.setPoiType(V2XPoiTypeEnum.ALERT_TRAFFIC_EXPRESS);
markerNoveltyInfo.setPoiType(EventTypeEnum.ALERT_TRAFFIC_EXPRESS.getPoiType());
markerNoveltyInfo.setItems(items);
markerNoveltyInfo.setUploadType("1");

View File

@@ -12,11 +12,10 @@ import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.PagerSnapHelper;
import androidx.recyclerview.widget.RecyclerView;
import com.mogo.module.common.entity.MarkerPoiTypeEnum;
import com.mogo.module.common.entity.V2XEventShowEntity;
import com.mogo.module.common.entity.V2XMessageEntity;
import com.mogo.module.common.entity.V2XPoiTypeEnum;
import com.mogo.module.common.entity.V2XRoadEventEntity;
import com.mogo.module.common.enums.EventTypeEnum;
import com.mogo.module.v2x.R;
import com.mogo.module.v2x.V2XServiceManager;
import com.mogo.module.v2x.adapter.V2XRoadEventAdapter;
@@ -33,7 +32,6 @@ import com.mogo.module.v2x.voice.V2XVoicePagingListener;
import java.util.ArrayList;
import java.util.List;
import static com.mogo.module.common.entity.MarkerPoiTypeEnum.FOURS_BLOCK_UP;
/**
* author : donghongyu
@@ -171,37 +169,35 @@ public class V2XRoadEventWindow extends V2XBasWindow
//Logger.d(MODULE_NAME, "V2X===道路事件:" + v2XRoadEventEntity);
// 进行类型分发
switch (v2XRoadEventEntity.getPoiType()) {
case V2XPoiTypeEnum.TRAFFIC_CHECK: // 交通检查
case V2XPoiTypeEnum.ROAD_CLOSED://封路
case V2XPoiTypeEnum.FOURS_ROAD_WORK://施工
case FOURS_BLOCK_UP://拥堵
case V2XPoiTypeEnum.FOURS_PONDING://积水
case V2XPoiTypeEnum.FOURS_FOG://浓雾
case V2XPoiTypeEnum.FOURS_ICE://结冰
case V2XPoiTypeEnum.FOURS_ACCIDENT://事故
case MarkerPoiTypeEnum.FOURS_ACCIDENT_01: // 重大事故
case MarkerPoiTypeEnum.FOURS_ACCIDENT_02: // 特大事故
case MarkerPoiTypeEnum.FOURS_ACCIDENT_03: // 较大事故
case MarkerPoiTypeEnum.FOURS_ACCIDENT_04: // 一般事故
case MarkerPoiTypeEnum.FOURS_ACCIDENT_05: // 轻微事故
case V2XPoiTypeEnum.FOURS_LIVING://实时路况
case V2XPoiTypeEnum.FOURS_NEALY://身边
// 展示道路事件本身详情
if (mItemList.isEmpty()) {
V2XEventShowEntity v2XEventShowEntity = new V2XEventShowEntity();
v2XEventShowEntity.setViewType(V2XMessageEntity.V2XTypeEnum.ALERT_ROAD_WARNING);
v2XEventShowEntity.setV2XRoadEventEntity(v2XRoadEventEntity);
mItemList.add(v2XEventShowEntity);
}
// 获取道路事件周边的直播车机
V2XServiceManager
.getV2XRefreshModel()
.queryNearbyVehicleLiveByLocation(
this,
v2XRoadEventEntity.getLocation().getLon(),
v2XRoadEventEntity.getLocation().getLat());
break;
if (EventTypeEnum.TRAFFIC_CHECK.getPoiType().equals(v2XRoadEventEntity.getPoiType())
|| EventTypeEnum.ROAD_CLOSED.getPoiType().equals(v2XRoadEventEntity.getPoiType())
|| EventTypeEnum.FOURS_ROAD_WORK.getPoiType().equals(v2XRoadEventEntity.getPoiType())
|| EventTypeEnum.FOURS_BLOCK_UP.getPoiType().equals(v2XRoadEventEntity.getPoiType())
|| EventTypeEnum.FOURS_PONDING.getPoiType().equals(v2XRoadEventEntity.getPoiType())
|| EventTypeEnum.FOURS_FOG.getPoiType().equals(v2XRoadEventEntity.getPoiType())
|| EventTypeEnum.FOURS_ICE.getPoiType().equals(v2XRoadEventEntity.getPoiType())
|| EventTypeEnum.FOURS_ACCIDENT.getPoiType().equals(v2XRoadEventEntity.getPoiType())
|| EventTypeEnum.FOURS_ACCIDENT_01.getPoiType().equals(v2XRoadEventEntity.getPoiType())
|| EventTypeEnum.FOURS_ACCIDENT_02.getPoiType().equals(v2XRoadEventEntity.getPoiType())
|| EventTypeEnum.FOURS_ACCIDENT_03.getPoiType().equals(v2XRoadEventEntity.getPoiType())
|| EventTypeEnum.FOURS_ACCIDENT_04.getPoiType().equals(v2XRoadEventEntity.getPoiType())
|| EventTypeEnum.FOURS_ACCIDENT_05.getPoiType().equals(v2XRoadEventEntity.getPoiType())
|| EventTypeEnum.FOURS_LIVING.getPoiType().equals(v2XRoadEventEntity.getPoiType())
|| EventTypeEnum.FOURS_NEALY.getPoiType().equals(v2XRoadEventEntity.getPoiType())) {
// 展示道路事件本身详情
if (mItemList.isEmpty()) {
V2XEventShowEntity v2XEventShowEntity = new V2XEventShowEntity();
v2XEventShowEntity.setViewType(V2XMessageEntity.V2XTypeEnum.ALERT_ROAD_WARNING);
v2XEventShowEntity.setV2XRoadEventEntity(v2XRoadEventEntity);
mItemList.add(v2XEventShowEntity);
}
// 获取道路事件周边的直播车机
V2XServiceManager
.getV2XRefreshModel()
.queryNearbyVehicleLiveByLocation(
this,
v2XRoadEventEntity.getLocation().getLon(),
v2XRoadEventEntity.getLocation().getLat());
}
}
// 刷新列表

View File

@@ -2,9 +2,9 @@ package com.mogo.module.v2x.scenario.scene.seek;
import android.content.Context;
import com.mogo.module.common.enums.EventTypeEnum;
import com.mogo.module.v2x.V2XServiceManager;
import com.mogo.module.v2x.entity.net.V2XSpecialCarRes.V2XMarkerEntity;
import com.mogo.module.common.entity.V2XPoiTypeEnum;
import com.mogo.module.v2x.listener.V2XMarkerClickListener;
import com.mogo.module.v2x.scenario.view.IV2XMarker;
import com.mogo.module.v2x.utils.MarkerUtils;
@@ -31,7 +31,7 @@ public class V2XSeekHelpMarker implements IV2XMarker<List<V2XMarkerEntity>> {
Context context = V2XServiceManager.getContext();
for (V2XMarkerEntity coordinate : entity) {
//故障车机
if (coordinate.getTargetId() == V2XPoiTypeEnum.ALERT_CAR_TROUBLE_WARNING) {
if (EventTypeEnum.ALERT_CAR_TROUBLE_WARNING.getPoiType().equals(coordinate.getTargetId()+"")) {
//绘制
V2XServiceManager
.getMoGoV2XMarkerManager()

View File

@@ -6,9 +6,9 @@ import android.view.ViewGroup;
import androidx.annotation.Nullable;
import com.mogo.module.common.entity.V2XMessageEntity;
import com.mogo.module.common.entity.V2XPoiTypeEnum;
import com.mogo.module.common.entity.V2XPushMessageEntity;
import com.mogo.module.common.entity.V2XRoadEventEntity;
import com.mogo.module.common.enums.EventTypeEnum;
import com.mogo.module.v2x.R;
import com.mogo.module.v2x.V2XServiceManager;
import com.mogo.module.v2x.entity.net.V2XSpecialCarRes.V2XMarkerEntity;
@@ -16,14 +16,10 @@ import com.mogo.module.v2x.scenario.impl.AbsV2XScenario;
import com.mogo.module.v2x.utils.ADASUtils;
import com.mogo.module.v2x.utils.V2XSQLiteUtils;
import com.mogo.module.v2x.utils.V2XUtils;
import com.mogo.service.entrance.IMogoEntranceButtonController;
import com.mogo.service.windowview.IMogoTopViewStatusListener;
import com.mogo.utils.logger.Logger;
import java.util.List;
import static com.mogo.module.v2x.V2XConst.MODULE_NAME;
/**
* author : donghongyu
* e-mail : 1358506549@qq.com
@@ -49,7 +45,7 @@ public class V2XSeekHelpScenario extends AbsV2XScenario<List<V2XMarkerEntity>> i
// 广播给ADAS和Launcher卡片
V2XRoadEventEntity eventEntity = new V2XRoadEventEntity();
eventEntity.setPoiType(V2XPoiTypeEnum.ALERT_CAR_TROUBLE_WARNING + "");
eventEntity.setPoiType(EventTypeEnum.ALERT_CAR_TROUBLE_WARNING.getPoiType());
eventEntity.setExpireTime(30000);
eventEntity.setTts("发现其他车主的求助信息");
eventEntity.setAlarmContent("其他车主求助");

View File

@@ -1,364 +0,0 @@
package com.mogo.module.v2x.utils;
import com.mogo.module.common.entity.V2XPoiTypeEnum;
import com.mogo.module.common.marker.PoiWrapper;
import com.mogo.module.common.utils.CloudPoiManager;
import com.mogo.module.v2x.R;
import com.mogo.module.v2x.V2XServiceManager;
import com.mogo.module.v2x.voice.V2XVoiceConstants;
import com.mogo.utils.logger.Logger;
/**
* @ProjectName: MoGoModulSafeDriving
* @Package: com.mogo.module.v2x.utils
* @ClassName: EventTypeUtils
* @Description: java类作用描述
* @Author: fenghl
* @CreateDate: 2020/5/20 17:10
* @UpdateUser: 更新者:
* @UpdateDate: 2020/5/20 17:10
* @UpdateRemark: 更新说明:
* @Version: 1.0
*/
public class EventTypeUtils {
public static String getPoiTypeStr(String poiType) {
// 先获取网络配置的poi对应的名称
PoiWrapper wrapper = CloudPoiManager.getInstance().getWrapperByPoiType(poiType);
if (wrapper != null) {
//Logger.d("EventTypeUtils", "从配置表中拿到了相关数据: " + wrapper.getTitle());
return wrapper.getTitle();
}
// 如果获取不到,那么就用本地默认的
String str = "其它道路事件";
switch (poiType) {
// 停车场
case V2XPoiTypeEnum.FOURS_PARKING:
str = "停车场";
break;
// 加油站
case V2XPoiTypeEnum.GAS_STATION:
str = "加油站";
break;
// 交通检查
case V2XPoiTypeEnum.TRAFFIC_CHECK:
str = "交通检查";
break;
// 封路
case V2XPoiTypeEnum.ROAD_CLOSED:
str = "封路";
break;
// 施工
case V2XPoiTypeEnum.FOURS_ROAD_WORK:
str = "道路施工";
break;
// 拥堵
case V2XPoiTypeEnum.FOURS_BLOCK_UP:
str = "道路拥堵";
break;
// 积水
case V2XPoiTypeEnum.FOURS_PONDING:
str = "道路积水";
break;
// 浓雾
case V2XPoiTypeEnum.FOURS_FOG:
str = "出现浓雾";
break;
// 结冰
case V2XPoiTypeEnum.FOURS_ICE:
str = "路面结冰";
break;
// 事故
case V2XPoiTypeEnum.FOURS_ACCIDENT:
case V2XPoiTypeEnum.FOURS_ACCIDENT_01: // 重大事故
case V2XPoiTypeEnum.FOURS_ACCIDENT_02: // 特大事故
case V2XPoiTypeEnum.FOURS_ACCIDENT_03: // 较大事故
case V2XPoiTypeEnum.FOURS_ACCIDENT_04: // 一般事故
case V2XPoiTypeEnum.FOURS_ACCIDENT_05: // 轻微事故
str = "交通事故";
break;
// 实时路况
case V2XPoiTypeEnum.FOURS_LIVING:
str = "实时路况";
break;
// 身边
case V2XPoiTypeEnum.FOURS_NEALY:
str = "身边事件";
break;
default:
str = "其它道路事件";
break;
}
return str;
}
public static int getPoiTypeSrcVr(String poiType) {
int src;
switch (poiType) {
// 拥堵
case V2XPoiTypeEnum.FOURS_BLOCK_UP:
src = R.drawable.v2x_icon_yongdu_vr;
break;
// 积水
case V2XPoiTypeEnum.FOURS_PONDING:
src = R.drawable.v2x_icon_jishui_vr;
break;
// 浓雾
case V2XPoiTypeEnum.FOURS_FOG:
src = R.drawable.v2x_icon_nongwu_vr;
break;
// 封路
case V2XPoiTypeEnum.ROAD_CLOSED:
src = R.drawable.v2x_icon_fenglu_vr;
break;
// 施工
case V2XPoiTypeEnum.FOURS_ROAD_WORK:
src = R.drawable.v2x_icon_daolushigong_vr;
break;
// 事故
case V2XPoiTypeEnum.FOURS_ACCIDENT:
case V2XPoiTypeEnum.FOURS_ACCIDENT_01: // 重大事故
case V2XPoiTypeEnum.FOURS_ACCIDENT_02: // 特大事故
case V2XPoiTypeEnum.FOURS_ACCIDENT_03: // 较大事故
case V2XPoiTypeEnum.FOURS_ACCIDENT_04: // 一般事故
case V2XPoiTypeEnum.FOURS_ACCIDENT_05: // 轻微事故
src = R.drawable.v2x_icon_jiaotongshigu_vr;
break;
// 交通检查
case V2XPoiTypeEnum.TRAFFIC_CHECK:
src = R.drawable.v2x_icon_jiaotongjiancha_vr;
break;
default:
src = R.drawable.v2x_icon_live_logo;
break;
}
return src;
}
public static String getPoiTypeStrVr(String poiType) {
String str = "其它道路事件";
switch (poiType) {
// 拥堵
case V2XPoiTypeEnum.FOURS_BLOCK_UP:
str = "前方拥堵";
break;
// 积水
case V2XPoiTypeEnum.FOURS_PONDING:
str = "前方道路积水";
break;
// 浓雾
case V2XPoiTypeEnum.FOURS_FOG:
str = "浓雾预警";
break;
// 封路
case V2XPoiTypeEnum.ROAD_CLOSED:
str = "前方封路";
break;
// 施工
case V2XPoiTypeEnum.FOURS_ROAD_WORK:
str = "前方施工";
break;
// 事故
case V2XPoiTypeEnum.FOURS_ACCIDENT:
case V2XPoiTypeEnum.FOURS_ACCIDENT_01: // 重大事故
case V2XPoiTypeEnum.FOURS_ACCIDENT_02: // 特大事故
case V2XPoiTypeEnum.FOURS_ACCIDENT_03: // 较大事故
case V2XPoiTypeEnum.FOURS_ACCIDENT_04: // 一般事故
case V2XPoiTypeEnum.FOURS_ACCIDENT_05: // 轻微事故
str = "前方交通事故";
break;
// 交通检查
case V2XPoiTypeEnum.TRAFFIC_CHECK:
str = "前方交通检查";
break;
default:
str = "其它道路事件";
break;
}
return str;
}
/**
* 获取道路事件的背景色
*
* @param poiType poi类型
* @return 背景
*/
public static int getPoiTypeBg(String poiType) {
int strBg;
switch (poiType) {
case V2XPoiTypeEnum.FOURS_PARKING: // 停车场
case V2XPoiTypeEnum.GAS_STATION: // 加油站
strBg = R.drawable.bg_v2x_event_type_blue;
break;
case V2XPoiTypeEnum.FOURS_BLOCK_UP: // 拥堵
case V2XPoiTypeEnum.FOURS_LIVING: // 实时路况
case V2XPoiTypeEnum.FOURS_NEALY: // 身边
strBg = V2XServiceManager.getMoGoStatusManager().isVrMode() ? R.drawable.bg_v2x_event_type_orange_vr : R.drawable.bg_v2x_event_type_orange;
break;
case V2XPoiTypeEnum.TRAFFIC_CHECK:// 交通检查
case V2XPoiTypeEnum.ROAD_CLOSED:// 封路
case V2XPoiTypeEnum.FOURS_ROAD_WORK:// 施工
case V2XPoiTypeEnum.FOURS_PONDING:// 积水
case V2XPoiTypeEnum.FOURS_FOG: // 浓雾
case V2XPoiTypeEnum.FOURS_ICE: // 结冰
case V2XPoiTypeEnum.FOURS_ACCIDENT: // 事故
case V2XPoiTypeEnum.FOURS_ACCIDENT_01: // 重大事故
case V2XPoiTypeEnum.FOURS_ACCIDENT_02: // 特大事故
case V2XPoiTypeEnum.FOURS_ACCIDENT_03: // 较大事故
case V2XPoiTypeEnum.FOURS_ACCIDENT_04: // 一般事故
case V2XPoiTypeEnum.FOURS_ACCIDENT_05: // 轻微事故
strBg = V2XServiceManager.getMoGoStatusManager().isVrMode() ? R.drawable.bg_v2x_event_type_red_vr : R.drawable.bg_v2x_event_type_read;
break;
default:
strBg = V2XServiceManager.getMoGoStatusManager().isVrMode() ? R.drawable.bg_v2x_event_type_red_vr : R.drawable.bg_v2x_event_type_read;
break;
}
return strBg;
}
/*
* VR模式下道路类型影响到分享列表 (VR模式暂时没有事件面板,所以可以删除此方法,公用上边的getPoiTypeBg)
* */
public static int getPoiTypeBgForShareItem(String poiType) {
int strBg;
switch (poiType) {
case V2XPoiTypeEnum.FOURS_PARKING: // 停车场
case V2XPoiTypeEnum.GAS_STATION: // 加油站
strBg = R.drawable.bg_v2x_event_type_blue;
break;
case V2XPoiTypeEnum.FOURS_BLOCK_UP: // 拥堵
case V2XPoiTypeEnum.FOURS_LIVING: // 实时路况
case V2XPoiTypeEnum.FOURS_NEALY: // 身边
strBg = R.drawable.bg_v2x_event_type_orange;
break;
case V2XPoiTypeEnum.TRAFFIC_CHECK:// 交通检查
case V2XPoiTypeEnum.ROAD_CLOSED:// 封路
case V2XPoiTypeEnum.FOURS_ROAD_WORK:// 施工
case V2XPoiTypeEnum.FOURS_PONDING:// 积水
case V2XPoiTypeEnum.FOURS_FOG: // 浓雾
case V2XPoiTypeEnum.FOURS_ICE: // 结冰
case V2XPoiTypeEnum.FOURS_ACCIDENT: // 事故
case V2XPoiTypeEnum.FOURS_ACCIDENT_01: // 重大事故
case V2XPoiTypeEnum.FOURS_ACCIDENT_02: // 特大事故
case V2XPoiTypeEnum.FOURS_ACCIDENT_03: // 较大事故
case V2XPoiTypeEnum.FOURS_ACCIDENT_04: // 一般事故
case V2XPoiTypeEnum.FOURS_ACCIDENT_05: // 轻微事故
strBg = R.drawable.bg_v2x_event_type_read;
break;
default:
strBg = R.drawable.bg_v2x_event_type_read;
break;
}
return strBg;
}
/**
* 判断是否是道路预警事件
*
* @param poiType
* @return
*/
public static boolean isRoadEvent(String poiType) {
boolean isRoadEvent = false;
// 进行类型分发
switch (poiType) {
case V2XPoiTypeEnum.TRAFFIC_CHECK: // 交通检查
case V2XPoiTypeEnum.ROAD_CLOSED://封路
case V2XPoiTypeEnum.FOURS_ROAD_WORK://施工
case V2XPoiTypeEnum.FOURS_BLOCK_UP://拥堵
case V2XPoiTypeEnum.FOURS_PONDING://积水
case V2XPoiTypeEnum.FOURS_FOG://浓雾
case V2XPoiTypeEnum.FOURS_ICE://结冰
case V2XPoiTypeEnum.FOURS_ACCIDENT://事故
case V2XPoiTypeEnum.FOURS_ACCIDENT_01: // 重大事故
case V2XPoiTypeEnum.FOURS_ACCIDENT_02: // 特大事故
case V2XPoiTypeEnum.FOURS_ACCIDENT_03: // 较大事故
case V2XPoiTypeEnum.FOURS_ACCIDENT_04: // 一般事故
case V2XPoiTypeEnum.FOURS_ACCIDENT_05: // 轻微事故
isRoadEvent = true;
break;
}
return isRoadEvent;
}
/**
* 是否需要UGC预警
*
* @param poiType
* @return
*/
public static boolean isNeedRoadEventUgc(String poiType) {
boolean isRoadEvent = false;
// 进行类型分发
switch (poiType) {
case V2XPoiTypeEnum.ROAD_CLOSED://封路
case V2XPoiTypeEnum.FOURS_ROAD_WORK://施工
case V2XPoiTypeEnum.FOURS_BLOCK_UP://拥堵
case V2XPoiTypeEnum.FOURS_ACCIDENT://事故
case V2XPoiTypeEnum.FOURS_ACCIDENT_01: // 重大事故
case V2XPoiTypeEnum.FOURS_ACCIDENT_02: // 特大事故
case V2XPoiTypeEnum.FOURS_ACCIDENT_03: // 较大事故
case V2XPoiTypeEnum.FOURS_ACCIDENT_04: // 一般事故
case V2XPoiTypeEnum.FOURS_ACCIDENT_05: // 轻微事故
isRoadEvent = true;
break;
}
return isRoadEvent;
}
/**
* 获取 UGC 问答使用的 Title 和 TTS 以及展示图表
*
* @param poiType 事件类型
* @return UGC 文案
*/
public static Object[] getUgcTitleStr(String poiType) {
Object[] str = new Object[5];
switch (poiType) {
// 封路
case V2XPoiTypeEnum.ROAD_CLOSED:
str[0] = "你刚经过 #### \n封路吗";
str[1] = "你刚路过的路段封路吗?您可以直接对我说封路、或者不封路。";
str[2] = R.drawable.v_to_x_event_ugc_fenglu;
str[3] = V2XVoiceConstants.COMMAND_ZHIDAO_V2X_FEEDBACK_FENG_LU_YES_UN_WAKEUP;
str[4] = V2XVoiceConstants.COMMAND_ZHIDAO_V2X_FEEDBACK_FENG_LU_NO_UN_WAKEUP;
break;
// 施工
case V2XPoiTypeEnum.FOURS_ROAD_WORK:
str[0] = "你刚经过 #### \n有道路施工吗";
str[1] = "你刚路过的路段道路施工吗?您可以直接对我说有施工、或者没有施工。";
str[2] = R.drawable.v_to_x_event_ugc_shigong;
str[3] = V2XVoiceConstants.COMMAND_ZHIDAO_V2X_FEEDBACK_SHI_GONG_YES_UN_WAKEUP;
str[4] = V2XVoiceConstants.COMMAND_ZHIDAO_V2X_FEEDBACK_SHI_GONG_NO_UN_WAKEUP;
break;
// 拥堵
case V2XPoiTypeEnum.FOURS_BLOCK_UP:
str[0] = "你刚路过 #### \n堵不堵";
str[1] = "你刚路过的路段堵不堵?您可以直接对我说拥赌、或者不堵。";
str[2] = R.drawable.v_to_x_event_ugc_yongdu;
str[3] = V2XVoiceConstants.COMMAND_ZHIDAO_V2X_FEEDBACK_YONG_DU_YES_UN_WAKEUP;
str[4] = V2XVoiceConstants.COMMAND_ZHIDAO_V2X_FEEDBACK_YONG_DU_NO_UN_WAKEUP;
break;
// 事故
case V2XPoiTypeEnum.FOURS_ACCIDENT:
case V2XPoiTypeEnum.FOURS_ACCIDENT_01: // 重大事故
case V2XPoiTypeEnum.FOURS_ACCIDENT_02: // 特大事故
case V2XPoiTypeEnum.FOURS_ACCIDENT_03: // 较大事故
case V2XPoiTypeEnum.FOURS_ACCIDENT_04: // 一般事故
case V2XPoiTypeEnum.FOURS_ACCIDENT_05: // 轻微事故
str[0] = "你刚经过 #### \n有事故发生吗";
str[1] = "你刚路过的路段有交通事故吗?您可以直接对我说有事故、或者没有事故。";
str[2] = R.drawable.v_to_x_event_ugc_shigu;
str[3] = V2XVoiceConstants.COMMAND_ZHIDAO_V2X_FEEDBACK_SHI_GU_YES_UN_WAKEUP;
str[4] = V2XVoiceConstants.COMMAND_ZHIDAO_V2X_FEEDBACK_SHI_GU_NO_UN_WAKEUP;
break;
default:
return null;
}
return str;
}
}

View File

@@ -7,7 +7,7 @@ import com.mogo.map.MogoLatLng;
import com.mogo.map.marker.IMogoMarkerClickListener;
import com.mogo.module.common.entity.MarkerLocation;
import com.mogo.module.common.entity.MarkerShowEntity;
import com.mogo.module.common.entity.V2XPoiTypeEnum;
import com.mogo.module.common.enums.EventTypeEnum;
import com.mogo.module.common.utils.CarSeries;
import com.mogo.module.v2x.V2XConst;
import com.mogo.module.v2x.V2XServiceManager;
@@ -41,7 +41,7 @@ public class MarkerUtils {
V2XServiceManager.getMarkerManager().removeMarkers(V2XConst.V2X_MARKER_SPECIAL_CAR);
// 循环绘制
for (V2XMarkerEntity v2XMarkerEntity : v2XSpecialCarRes.getCoordinates()) {
if (v2XMarkerEntity.getTargetId() != V2XPoiTypeEnum.ALERT_CAR_TROUBLE_WARNING) {
if (!EventTypeEnum.ALERT_CAR_TROUBLE_WARNING.getPoiType().equals(v2XMarkerEntity.getTargetId()+"")) {
MarkerLocation markerLocation = new MarkerLocation();
markerLocation.setLon(v2XMarkerEntity.getLon());
markerLocation.setLat(v2XMarkerEntity.getLat());