Merge branch 'dev_robotaxi-d-app-module_280_220608_2.8.0' of gitlab.zhidaoauto.com:zhjt/AndroidApp/MoGoEagleEye into dev_robotaxi-d-app-module_280_220608_2.8.0
This commit is contained in:
@@ -16,12 +16,12 @@ public class BusRoutesResult {
|
||||
private int status;
|
||||
|
||||
//线路轨迹相关字段
|
||||
public String csvFileUrl; //轨迹文件下载的cos url,默认“”
|
||||
public String csvFileMd5; //轨迹文件md5,默认“”
|
||||
public String txtFileUrl; //打点文件下载的cos url,默认“”
|
||||
public String txtFileMd5; //轨迹文件md5,默认“”
|
||||
public String csvFileUrl = ""; //轨迹文件下载的cos url,默认“”
|
||||
public String csvFileMd5 = ""; //轨迹文件md5,默认“”
|
||||
public String txtFileUrl = ""; //打点文件下载的cos url,默认“”
|
||||
public String txtFileMd5 = ""; //轨迹文件md5,默认“”
|
||||
public long contrailSaveTime; //上传轨迹完成时间戳ms:用于MEC本地手动导入轨迹验证时不会被云端轨迹覆盖
|
||||
public String carModel; //[optional] 车型号(如红旗H9),默认“”,暂不加入校验逻辑、用于人工排查问题
|
||||
public String carModel = ""; //[optional] 车型号(如红旗H9),默认“”,暂不加入校验逻辑、用于人工排查问题
|
||||
|
||||
public int getLineId() {
|
||||
return lineId;
|
||||
@@ -48,6 +48,12 @@ public class BusRoutesResult {
|
||||
", lineType=" + lineType +
|
||||
", description='" + description + '\'' +
|
||||
", status=" + status +
|
||||
", csvFileUrl='" + csvFileUrl + '\'' +
|
||||
", csvFileMd5='" + csvFileMd5 + '\'' +
|
||||
", txtFileUrl='" + txtFileUrl + '\'' +
|
||||
", txtFileMd5='" + txtFileMd5 + '\'' +
|
||||
", contrailSaveTime=" + contrailSaveTime +
|
||||
", carModel='" + carModel + '\'' +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -77,10 +77,10 @@ public class BusFragment extends BaseBusTabFragment<BusFragment, BusPresenter>
|
||||
mPresenter.queryBusRoutes();
|
||||
});
|
||||
|
||||
mBus.setOnLongClickListener(view -> {
|
||||
getActivity().finish();
|
||||
return true;
|
||||
});
|
||||
// mBus.setOnLongClickListener(view -> {
|
||||
// getActivity().finish();
|
||||
// return true;
|
||||
// });
|
||||
//debug下调用测试面板
|
||||
mCurrentStationName.setOnLongClickListener(v -> {
|
||||
debugTestBar();
|
||||
@@ -288,7 +288,6 @@ public class BusFragment extends BaseBusTabFragment<BusFragment, BusPresenter>
|
||||
// 出车的时候重制站点状态
|
||||
mPresenter.queryBusRoutes();
|
||||
tvOperationStatus.setText("收车");
|
||||
showSlidePanle("滑动出发");
|
||||
showPanel();
|
||||
} else {
|
||||
AIAssist.getInstance(getContext()).speakTTSVoice("已收车");
|
||||
|
||||
@@ -15,6 +15,7 @@ import android.text.TextUtils;
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.amap.api.maps.model.LatLng;
|
||||
import com.elegant.network.utils.GsonUtil;
|
||||
import com.mogo.commons.AbsMogoApplication;
|
||||
import com.mogo.commons.debug.DebugConfig;
|
||||
import com.mogo.commons.voice.AIAssist;
|
||||
@@ -508,20 +509,27 @@ public class BusOrderModel {
|
||||
// == CallerAutoPilotStatusListenerManager.INSTANCE.getAutoPilotStatusInfo().getState()) {
|
||||
// ToastUtils.showShort("自动驾驶状态为不可用!");
|
||||
// }
|
||||
AutopilotControlParameters currentAutopilot = new AutopilotControlParameters();
|
||||
currentAutopilot.isSpeakVoice = !isRestart;
|
||||
currentAutopilot.routeID = busRoutesResult.getLineId();
|
||||
currentAutopilot.routeName = busRoutesResult.getName();
|
||||
currentAutopilot.startName = PinYinUtil.getPinYinHeadChar(currentStation.getName());
|
||||
currentAutopilot.endName = PinYinUtil.getPinYinHeadChar(nextStation.getName());
|
||||
currentAutopilot.startLatLon = new AutopilotControlParameters
|
||||
AutopilotControlParameters parameters = new AutopilotControlParameters();
|
||||
parameters.isSpeakVoice = !isRestart;
|
||||
parameters.routeID = busRoutesResult.getLineId();
|
||||
parameters.routeName = busRoutesResult.getName();
|
||||
parameters.startName = PinYinUtil.getPinYinHeadChar(currentStation.getName());
|
||||
parameters.endName = PinYinUtil.getPinYinHeadChar(nextStation.getName());
|
||||
parameters.startLatLon = new AutopilotControlParameters
|
||||
.AutoPilotLonLat( currentStation.getLat(), currentStation.getLon() );
|
||||
currentAutopilot.endLatLon = new AutopilotControlParameters
|
||||
parameters.endLatLon = new AutopilotControlParameters
|
||||
.AutoPilotLonLat( nextStation.getLat(), nextStation.getLon() );
|
||||
currentAutopilot.vehicleType = VEHICLE_TYPE;
|
||||
CallerLogger.INSTANCE.d( M_BUS + TAG, "开启自动驾驶====" + currentAutopilot.toString()
|
||||
parameters.vehicleType = VEHICLE_TYPE;
|
||||
if (parameters.autoPilotLine == null) {
|
||||
parameters.autoPilotLine = new AutopilotControlParameters.AutoPilotLine(
|
||||
busRoutesResult.getLineId(),
|
||||
busRoutesResult.csvFileUrl, busRoutesResult.csvFileMd5,
|
||||
busRoutesResult.txtFileUrl, busRoutesResult.txtFileMd5,
|
||||
busRoutesResult.contrailSaveTime, busRoutesResult.carModel);
|
||||
}
|
||||
CallerLogger.INSTANCE.d( M_BUS + TAG, "开启自动驾驶====" + GsonUtil.jsonFromObject(parameters)
|
||||
+" startLatLon="+currentStation.getName()+",endLatLon="+nextStation.getName());
|
||||
CallerAutoPilotManager.INSTANCE.startAutoPilot(currentAutopilot);
|
||||
CallerAutoPilotManager.INSTANCE.startAutoPilot(parameters);
|
||||
|
||||
triggerStartServiceEvent(isRestart, false);
|
||||
|
||||
|
||||
@@ -51,13 +51,13 @@ public class OrderQueryRespBean extends BaseData {
|
||||
public String passengerNum;
|
||||
|
||||
//线路轨迹相关字段
|
||||
public long lineId; //路线id,默认-1
|
||||
public String csvFileUrl; //轨迹文件下载的cos url,默认“”
|
||||
public String csvFileMd5; //轨迹文件md5,默认“”
|
||||
public String txtFileUrl; //打点文件下载的cos url,默认“”
|
||||
public String txtFileMd5; //轨迹文件md5,默认“”
|
||||
public long lineId = -1; //路线id,默认-1
|
||||
public String csvFileUrl = ""; //轨迹文件下载的cos url,默认“”
|
||||
public String csvFileMd5 = ""; //轨迹文件md5,默认“”
|
||||
public String txtFileUrl = ""; //打点文件下载的cos url,默认“”
|
||||
public String txtFileMd5 = ""; //轨迹文件md5,默认“”
|
||||
public long contrailSaveTime; //上传轨迹完成时间戳ms:用于MEC本地手动导入轨迹验证时不会被云端轨迹覆盖
|
||||
public String carModel; //[optional] 车型号(如红旗H9),默认“”,暂不加入校验逻辑、用于人工排查问题
|
||||
public String carModel = ""; //[optional] 车型号(如红旗H9),默认“”,暂不加入校验逻辑、用于人工排查问题
|
||||
|
||||
// !!!接口中暂无此字段,仅用于本地实现逻辑使用:起始站目的站距离km
|
||||
public double travelDistance;
|
||||
|
||||
@@ -872,6 +872,13 @@ public class TaxiModel {
|
||||
parameters.endName = PinYinUtil.getPinYinHeadChar(mCurrentOCHOrder.endSiteAddr); // 终点名称拼音首字母大写:科学城C区三号门(KXCCQSHM)
|
||||
parameters.startLatLon = new AutopilotControlParameters.AutoPilotLonLat(startWgsLat, startWgsLon);
|
||||
parameters.endLatLon = new AutopilotControlParameters.AutoPilotLonLat(endWgsLat, endWgsLon);
|
||||
if (parameters.autoPilotLine == null) {
|
||||
parameters.autoPilotLine = new AutopilotControlParameters.AutoPilotLine(
|
||||
mCurrentOCHOrder.lineId,
|
||||
mCurrentOCHOrder.csvFileUrl, mCurrentOCHOrder.csvFileMd5,
|
||||
mCurrentOCHOrder.txtFileUrl, mCurrentOCHOrder.txtFileMd5,
|
||||
mCurrentOCHOrder.contrailSaveTime, mCurrentOCHOrder.carModel);
|
||||
}
|
||||
CallerAutoPilotManager.INSTANCE.startAutoPilot(parameters);
|
||||
CallerLogger.INSTANCE.d(M_TAXI + TAG, "start autopilot with parameter: %s", GsonUtil.jsonFromObject(parameters)
|
||||
+ " ,startSiteName=" + mCurrentOCHOrder.startSiteAddr + " ,endSiteName=" + mCurrentOCHOrder.endSiteAddr);
|
||||
|
||||
29
app/src/main/java/com/mogo/launcher/stageone/APMStartup.kt
Normal file
29
app/src/main/java/com/mogo/launcher/stageone/APMStartup.kt
Normal file
@@ -0,0 +1,29 @@
|
||||
package com.mogo.launcher.stageone
|
||||
|
||||
import android.content.Context
|
||||
import com.rousetime.android_startup.AndroidStartup
|
||||
import com.alibaba.android.arouter.launcher.ARouter
|
||||
import com.mogo.test.crashreport.upgrade.UpgradeReportConstants
|
||||
import com.mogo.test.crashreport.CrashReportConstants
|
||||
|
||||
class APMStartup : AndroidStartup<Boolean?>() {
|
||||
override fun create(context: Context): Boolean? {
|
||||
// bugly
|
||||
ARouter.getInstance().build(UpgradeReportConstants.PATH).navigation()
|
||||
// apm
|
||||
ARouter.getInstance().build(CrashReportConstants.PATH).navigation()
|
||||
return true
|
||||
}
|
||||
|
||||
override fun callCreateOnMainThread(): Boolean {
|
||||
return true
|
||||
}
|
||||
|
||||
override fun waitOnMainThread(): Boolean {
|
||||
return false
|
||||
}
|
||||
|
||||
override fun dependenciesByName(): List<String> {
|
||||
return listOf("com.mogo.launcher.stageone.ARouterStartUp")
|
||||
}
|
||||
}
|
||||
@@ -62,7 +62,7 @@ class HttpDnsStartUp : AndroidStartup<Boolean>() {
|
||||
override fun waitOnMainThread() = false
|
||||
|
||||
override fun dependenciesByName(): List<String> {
|
||||
return listOf("com.mogo.launcher.stageone.ARouterStartUp", "com.mogo.launcher.stageone.ConfigStartUp")
|
||||
return listOf("com.mogo.launcher.stageone.APMStartup", "com.mogo.launcher.stageone.ConfigStartUp")
|
||||
}
|
||||
|
||||
override fun create(context: Context): Boolean {
|
||||
|
||||
@@ -96,13 +96,13 @@ public class MoGoHandAdasMsgManager implements
|
||||
CallerHmiManager.INSTANCE.showTurnLight(state);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAutopilotBrakeLightData(boolean brakeLight) {
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onAutopilotCarConfig(@NotNull MessagePad.CarConfigResp carConfigResp) {
|
||||
if (carConfigResp != null && !TextUtils.isEmpty(carConfigResp.getMacAddress())) {
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
package com.mogo.eagle.core.function.appupgrade.network;
|
||||
|
||||
import com.mogo.eagle.core.data.bindingcar.UpgradeAppInfo;
|
||||
|
||||
import io.reactivex.Observable;
|
||||
import okhttp3.RequestBody;
|
||||
import retrofit2.http.Body;
|
||||
import retrofit2.http.Headers;
|
||||
import retrofit2.http.POST;
|
||||
import retrofit2.http.Query;
|
||||
|
||||
/**
|
||||
* @author lixiaopeng
|
||||
* @description 绑定车辆
|
||||
* @since: 6/20/22
|
||||
*/
|
||||
public interface UpgradeApiService {
|
||||
/**
|
||||
* 获取升级信息
|
||||
* , @Query("resources") String i
|
||||
* @return {@link UpgradeAppInfo}
|
||||
*/
|
||||
@Headers("Content-Type:application/json;charset=UTF-8")
|
||||
@POST("unify/selectResources")
|
||||
Observable<UpgradeAppInfo> getUpgradeInfo(@Query("resources") String res, @Body RequestBody requestBody);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,104 @@
|
||||
package com.mogo.eagle.core.function.appupgrade.network;
|
||||
|
||||
import android.content.Context;
|
||||
import android.util.Log;
|
||||
|
||||
import com.mogo.cloud.passport.MoGoAiCloudClientConfig;
|
||||
import com.mogo.commons.constants.SharedPrefsConstants;
|
||||
import com.mogo.eagle.core.data.bindingcar.BindingcarInfo;
|
||||
import com.mogo.eagle.core.data.bindingcar.ModifyBindingcarInfo;
|
||||
import com.mogo.eagle.core.data.bindingcar.UpgradeAppInfo;
|
||||
import com.mogo.eagle.core.function.api.bindingcar.BindingcarCallBack;
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager;
|
||||
import com.mogo.eagle.core.network.MoGoRetrofitFactory;
|
||||
import com.mogo.eagle.core.network.utils.GsonUtil;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr;
|
||||
import com.mogo.eagle.core.utilcode.mogo.toast.TipToast;
|
||||
import com.mogo.eagle.core.utilcode.util.AppUtils;
|
||||
import com.mogo.eagle.core.utilcode.util.GsonUtils;
|
||||
import com.mogo.module.common.constants.HostConst;
|
||||
|
||||
import io.reactivex.Observer;
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers;
|
||||
import io.reactivex.annotations.NonNull;
|
||||
import io.reactivex.disposables.Disposable;
|
||||
import io.reactivex.schedulers.Schedulers;
|
||||
import okhttp3.MediaType;
|
||||
import okhttp3.RequestBody;
|
||||
|
||||
/**
|
||||
* @author lixiaopeng
|
||||
* @description 获取升级信息
|
||||
* @since: 3/25/22
|
||||
*/
|
||||
public class UpgradeAppNetWorkManager {
|
||||
private static volatile UpgradeAppNetWorkManager requestNoticeManager;
|
||||
private final UpgradeApiService mUpgradeApiService;
|
||||
private static final String TAG = "UpgradeAppNetWorkManager";
|
||||
|
||||
|
||||
private UpgradeAppNetWorkManager() {
|
||||
mUpgradeApiService = MoGoRetrofitFactory.getInstance(HostConst.UPGRADE_APP_HOST)
|
||||
.create(UpgradeApiService.class);
|
||||
}
|
||||
|
||||
public static UpgradeAppNetWorkManager getInstance() {
|
||||
if (requestNoticeManager == null) {
|
||||
synchronized (UpgradeAppNetWorkManager.class) {
|
||||
if (requestNoticeManager == null) {
|
||||
requestNoticeManager = new UpgradeAppNetWorkManager();
|
||||
}
|
||||
}
|
||||
}
|
||||
return requestNoticeManager;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取app升级信息
|
||||
*/
|
||||
public void getAppUpgradeInfo(Context context, String screenType) {
|
||||
// String sn = "X20202203105S688HZ";
|
||||
// int versionCode = 2070000;
|
||||
// String versionName = "2.7.0";
|
||||
|
||||
String sn = MoGoAiCloudClientConfig.getInstance().getSn();
|
||||
int versionCode = AppUtils.getAppVersionCode();
|
||||
String versionName = AppUtils.getAppVersionName();
|
||||
|
||||
UpgradeAppRequest request = new UpgradeAppRequest(sn, versionCode, versionName, screenType);
|
||||
RequestBody requestBody = RequestBody.create(MediaType.get("application/json;charset=UTF-8"), GsonUtil.jsonFromObject(request));
|
||||
mUpgradeApiService.getUpgradeInfo("apps_control", requestBody)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Observer<UpgradeAppInfo>() {
|
||||
@Override
|
||||
public void onSubscribe(@NonNull Disposable d) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(@NonNull UpgradeAppInfo info) {
|
||||
if (info != null && info.getData() != null && info.getData().size() > 0) {
|
||||
CallerLogger.INSTANCE.e(TAG, "UpgradeAppInfo url = " + info.getData().get(0).getApp_url() + "---info.getData().get(0).getVersion_code() = " + info.getData().get(0).getVersion_code());
|
||||
Log.d("liyz", "UpgradeAppInfo url = " + info.getData().get(0).getApp_url() + "----code = " + info.getData().get(0).getVersion_code());
|
||||
if (info.getData().get(0).getVersion_code() > versionCode) {
|
||||
CallerHmiManager.INSTANCE.showUpgradeDialog(info.getData().get(0).getApp_url().substring(info.getData().get(0).getApp_url().lastIndexOf("/")+1), info.getData().get(0).getApp_url());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(@NonNull Throwable e) {
|
||||
CallerLogger.INSTANCE.e(TAG, "UpgradeAppInfo onError e = " + e.toString() + "---e.getMessage = " + e.getMessage());
|
||||
Log.e("liyz", "UpgradeAppInfo onError e = " + e.toString() + "---e.getMessage = " + e.getMessage());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,71 @@
|
||||
package com.mogo.eagle.core.function.appupgrade.network;
|
||||
|
||||
/**
|
||||
* @author lixiaopeng
|
||||
* @description 获取app升级信息
|
||||
* @since: 11/15/21
|
||||
*/
|
||||
public class UpgradeAppRequest {
|
||||
// private String resources;
|
||||
private String sn;
|
||||
private int version_code;
|
||||
private String version_name;
|
||||
private String screen_type;
|
||||
|
||||
public UpgradeAppRequest(/*String resources,*/ String sn, int versionCode, String versionName, String type) {
|
||||
this.sn = sn;
|
||||
this.version_code = versionCode;
|
||||
this.version_name = versionName;
|
||||
this.screen_type = type;
|
||||
}
|
||||
|
||||
// public String getResources() {
|
||||
// return resources;
|
||||
// }
|
||||
//
|
||||
// public void setResources(String resources) {
|
||||
// this.resources = resources;
|
||||
// }
|
||||
|
||||
public String getSn() {
|
||||
return sn;
|
||||
}
|
||||
|
||||
public void setSn(String sn) {
|
||||
this.sn = sn;
|
||||
}
|
||||
|
||||
public int getVersion_code() {
|
||||
return version_code;
|
||||
}
|
||||
|
||||
public void setVersion_code(int version_code) {
|
||||
this.version_code = version_code;
|
||||
}
|
||||
|
||||
public String getVersion_name() {
|
||||
return version_name;
|
||||
}
|
||||
|
||||
public void setVersion_name(String version_name) {
|
||||
this.version_name = version_name;
|
||||
}
|
||||
|
||||
public String getScreen_type() {
|
||||
return screen_type;
|
||||
}
|
||||
|
||||
public void setScreen_type(String screen_type) {
|
||||
this.screen_type = screen_type;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "UpgradeAppRequest{" +
|
||||
"sn='" + sn + '\'' +
|
||||
", version_code=" + version_code +
|
||||
", version_name='" + version_name + '\'' +
|
||||
", screen_type=" + screen_type +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
@@ -9,6 +9,7 @@ import com.mogo.eagle.core.data.config.HmiBuildConfig;
|
||||
import com.mogo.eagle.core.data.constants.MogoServicePaths;
|
||||
import com.mogo.eagle.core.function.api.bindingcar.BindingcarCallBack;
|
||||
import com.mogo.eagle.core.function.api.bindingcar.IMoGoBindingcarProvider;
|
||||
import com.mogo.eagle.core.function.appupgrade.network.UpgradeAppNetWorkManager;
|
||||
import com.mogo.eagle.core.function.bindingcar.network.BindingcarNetWorkManager;
|
||||
import com.mogo.eagle.core.function.ipcupgrade.IPCUpgradeManager;
|
||||
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils;
|
||||
@@ -127,5 +128,12 @@ public class BindingcarProvider implements IMoGoBindingcarProvider {
|
||||
return screenType;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询app是否需要升级
|
||||
*/
|
||||
@Override
|
||||
public void queryAppUpgrade() {
|
||||
UpgradeAppNetWorkManager.getInstance().getAppUpgradeInfo(mContext, String.valueOf(getScreenType()));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package com.mogo.eagle.core.function.ipcupgrade
|
||||
|
||||
import android.content.Context
|
||||
import android.util.Log
|
||||
import com.mogo.aicloud.services.socket.IMogoOnMessageListener
|
||||
import com.mogo.aicloud.services.socket.MogoAiCloudSocketManager
|
||||
import com.mogo.cloud.passport.MoGoAiCloudClient
|
||||
|
||||
@@ -47,7 +47,9 @@ class IPCReportManager : IMoGoAutopilotStatusListener {
|
||||
it.src,it.level,it.msg,it.code,it.resultList,it.actionsList))
|
||||
//当前不处于美化模式时,展示监控节点上报
|
||||
if(!FunctionBuildConfig.isDemoMode){
|
||||
CallerHmiManager.showIPCReportWindow(ipcReportList)
|
||||
if(FunctionBuildConfig.isReportWarning){
|
||||
CallerHmiManager.showIPCReportWindow(ipcReportList)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,7 +31,10 @@ internal class CanImpl(ctx: Context): IFlow<CanStatus>(ctx), IMoGoAutopilotVehic
|
||||
timeOutCheck()
|
||||
}
|
||||
|
||||
private fun isCanEnabled() = CallerAutoPilotManager.isConnected() && CallerAutoPilotStatusListenerManager.getAutoPilotReportMessageCode() != "EHW_CAN"
|
||||
private fun isCanEnabled(): Boolean {
|
||||
val code = CallerAutoPilotStatusListenerManager.getAutoPilotReportMessageCode()
|
||||
return CallerAutoPilotManager.isConnected() && code != "EHW_CAN"
|
||||
}
|
||||
|
||||
|
||||
override fun onAutopilotBrakeLightData(brakeLight: Boolean) {
|
||||
|
||||
@@ -24,8 +24,16 @@ internal class RTKImpl(ctx: Context): IFlow<RTKStatus>(ctx), IMoGoAutopilotCarSt
|
||||
CallerAutoPilotStatusListenerManager.addListener(TAG, this)
|
||||
}
|
||||
|
||||
private fun isRTKEnabled() =
|
||||
CallerAutoPilotManager.isConnected() && (CallerAutoPilotStatusListenerManager.getAutoPilotReportMessageCode() != "EHW_RTK" && CallerAutoPilotStatusListenerManager.getAutoPilotReportMessageCode() != "EHW_GNSS") && CallerAutopilotCarStatusListenerManager.getCurrentGnssInfo() != null
|
||||
private fun isRTKEnabled(): Boolean {
|
||||
val code = CallerAutoPilotStatusListenerManager.getAutoPilotReportMessageCode()
|
||||
val gnssInfo = CallerAutopilotCarStatusListenerManager.getCurrentGnssInfo()
|
||||
return CallerAutoPilotManager.isConnected() && (
|
||||
code != "EHW_RTK" &&
|
||||
code != "EHW_GNSS" &&
|
||||
code != "ESYS_RTK_STATUS_FAULT" &&
|
||||
code != "ELCT_RTK_STATUS_FAULT" &&
|
||||
code != "ELCT_RTK_STATUS_UNKNOWN") && gnssInfo != null
|
||||
}
|
||||
|
||||
override fun onAutopilotCarStateData(gnssInfo: GnssInfo?) {
|
||||
send(RTKStatus(isRTKEnabled()))
|
||||
@@ -34,9 +42,7 @@ internal class RTKImpl(ctx: Context): IFlow<RTKStatus>(ctx), IMoGoAutopilotCarSt
|
||||
|
||||
override fun onAutopilotIpcConnectStatusChanged(status: Int, reason: String?) {
|
||||
super.onAutopilotIpcConnectStatusChanged(status, reason)
|
||||
if (!CallerAutoPilotManager.isConnected()) {
|
||||
send(RTKStatus(false))
|
||||
}
|
||||
send(RTKStatus(isRTKEnabled()))
|
||||
}
|
||||
|
||||
private fun timeOutCheck() {
|
||||
|
||||
@@ -46,6 +46,7 @@ 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
|
||||
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.notice.NoticeBannerView
|
||||
import com.mogo.eagle.core.function.hmi.ui.notice.NoticeNormalBannerView
|
||||
@@ -248,9 +249,7 @@ class MoGoHmiFragment : MvpFragment<MoGoHmiContract.View?, HmiPresenter?>(),
|
||||
}
|
||||
})
|
||||
ipcReportWindow?.let {
|
||||
if(FunctionBuildConfig.isWarningTone){
|
||||
SoundUtils.playRing(requireContext())
|
||||
}
|
||||
SoundUtils.playRing(requireContext())
|
||||
}
|
||||
}
|
||||
ipcReportWindow?.showFloatWindow()
|
||||
@@ -967,6 +966,7 @@ class MoGoHmiFragment : MvpFragment<MoGoHmiContract.View?, HmiPresenter?>(),
|
||||
|
||||
private var modifyBindingCarDialog: ModifyBindingCarDialog? = null
|
||||
private var toBindingCarDialog: ToBindingCarDialog? = null
|
||||
private var upgradeAppDialog: UpgradeAppDialog? = null
|
||||
|
||||
override fun showToBindingcarDialog() {
|
||||
if (toBindingCarDialog == null) {
|
||||
@@ -980,7 +980,16 @@ class MoGoHmiFragment : MvpFragment<MoGoHmiContract.View?, HmiPresenter?>(),
|
||||
modifyBindingCarDialog = ModifyBindingCarDialog(requireContext())
|
||||
}
|
||||
modifyBindingCarDialog!!.showModifyBindingcarDialog()
|
||||
}
|
||||
|
||||
/**
|
||||
* 升级app弹框
|
||||
*/
|
||||
override fun showUpgradeDialog(name: String, url: String) {
|
||||
if (upgradeAppDialog == null) {
|
||||
upgradeAppDialog = UpgradeAppDialog(requireContext())
|
||||
}
|
||||
upgradeAppDialog!!.showUpgradeAppDialog(name, url)
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -0,0 +1,77 @@
|
||||
package com.mogo.eagle.core.function.hmi.ui.bindingcar
|
||||
|
||||
import android.content.Context
|
||||
import android.util.Log
|
||||
import android.widget.TextView
|
||||
import androidx.lifecycle.LifecycleObserver
|
||||
import com.mogo.eagle.core.function.call.bindingcar.CallerBindingcarManager
|
||||
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
import com.mogo.eagle.core.utilcode.mogo.toast.TipToast
|
||||
import com.mogo.eagle.core.utilcode.util.ToastUtils
|
||||
import com.mogo.module.common.dialog.BaseFloatDialog
|
||||
import com.mogo.service.IMogoServiceApis
|
||||
import com.mogo.service.statusmanager.IMogoStatusChangedListener
|
||||
import com.mogo.service.statusmanager.StatusDescriptor
|
||||
|
||||
/**
|
||||
* @brief APP升级提示弹框
|
||||
* @author lixiaopeng
|
||||
*/
|
||||
class UpgradeAppDialog(context: Context) : BaseFloatDialog(context), LifecycleObserver{
|
||||
|
||||
private val TAG = "UpgradeAppDialog"
|
||||
private var confirmTv: TextView? = null
|
||||
private var cancleTv: TextView? = null
|
||||
private var tag: String? = null
|
||||
private var downloarUrl: String? = null
|
||||
|
||||
private var mServiceApis: IMogoServiceApis? = null
|
||||
private val statusChangedListenerForCheckNotice = IMogoStatusChangedListener { descriptor, isTrue ->
|
||||
if (descriptor == StatusDescriptor.MAIN_PAGE_IS_BACKGROUND) {
|
||||
dismiss()
|
||||
}
|
||||
}
|
||||
|
||||
init {
|
||||
setContentView(R.layout.dialog_upgrade_app)
|
||||
setCanceledOnTouchOutside(true)
|
||||
|
||||
confirmTv = findViewById(R.id.tv_upgrade_confirm)
|
||||
cancleTv = findViewById(R.id.tv_upgrade_cancel)
|
||||
|
||||
confirmTv?.setOnClickListener {
|
||||
downloadApp()
|
||||
}
|
||||
|
||||
cancleTv?.setOnClickListener {
|
||||
dismiss()
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 去下载
|
||||
*/
|
||||
fun downloadApp() {
|
||||
Log.d("liyz", "UpgradeAppDialog tag = $tag ---- downloarUrl = $downloarUrl")
|
||||
ToastUtils.showLong("开始下载APK,稍后可前往downloads文件夹查看")
|
||||
tag?.let { downloarUrl?.let { it1 -> CallerDevaToolsManager.downLoadPackage(it, it1) } }
|
||||
|
||||
dismiss()
|
||||
}
|
||||
|
||||
override fun dismiss() {
|
||||
super.dismiss()
|
||||
}
|
||||
|
||||
fun showUpgradeAppDialog(name: String, url: String) {
|
||||
if (isShowing) {
|
||||
return
|
||||
}
|
||||
tag = name
|
||||
downloarUrl = url
|
||||
show()
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -64,6 +64,8 @@ import com.mogo.eagle.core.utilcode.util.*
|
||||
import com.mogo.map.MogoMap
|
||||
import com.mogo.map.uicontroller.VisualAngleMode
|
||||
import com.mogo.map.uicontroller.VisualAngleMode.*
|
||||
import com.mogo.module.service.routeoverlay.*
|
||||
import com.tencent.liteav.basic.datareport.a.B
|
||||
import com.zhidao.easysocket.utils.L
|
||||
import kotlinx.android.synthetic.main.view_debug_setting.view.*
|
||||
import mogo.telematics.pad.MessagePad
|
||||
@@ -779,10 +781,10 @@ class DebugSettingView @JvmOverloads constructor(
|
||||
}
|
||||
}
|
||||
|
||||
//是否开启异常上报语音提示
|
||||
tbWarningTone.isChecked = FunctionBuildConfig.isWarningTone
|
||||
tbWarningTone.setOnCheckedChangeListener { _, isChecked ->
|
||||
FunctionBuildConfig.isWarningTone = isChecked
|
||||
//是否开启异常上报
|
||||
tbReportWarning.isChecked = FunctionBuildConfig.isReportWarning
|
||||
tbReportWarning.setOnCheckedChangeListener { _, isChecked ->
|
||||
FunctionBuildConfig.isReportWarning = isChecked
|
||||
}
|
||||
|
||||
}
|
||||
@@ -965,6 +967,16 @@ class DebugSettingView @JvmOverloads constructor(
|
||||
accelerationIsShow = isChecked
|
||||
}
|
||||
|
||||
tbRouteDynamicEffect.isChecked = AppIdentityModeUtils.isTaxi(FunctionBuildConfig.appIdentityMode)
|
||||
|
||||
tbRouteDynamicEffect.setOnCheckedChangeListener { _, isChecked ->
|
||||
if (isChecked) {
|
||||
RouteStrategy.enable(true)
|
||||
} else {
|
||||
RouteStrategy.enable(false)
|
||||
}
|
||||
}
|
||||
|
||||
btnThresholdDefine.setOnClickListener {
|
||||
try {
|
||||
accelerationThresholdNum = etThreshold.text.toString().toDouble()
|
||||
|
||||
@@ -74,7 +74,8 @@ class AutoPilotAndCheckView @JvmOverloads constructor(
|
||||
ToastUtils.showShort("超过最大限速值60,设置失败")
|
||||
}
|
||||
else -> {
|
||||
llSpeedPosition.background = resources.getDrawable(R.drawable.pilot_speed_bg)
|
||||
llSpeedPosition.background =
|
||||
resources.getDrawable(R.drawable.pilot_speed_bg)
|
||||
keyBoardUtil?.hideKeyboard()
|
||||
etInputSpeed.clearFocus()
|
||||
// 设置自动驾驶速度
|
||||
@@ -107,13 +108,15 @@ class AutoPilotAndCheckView @JvmOverloads constructor(
|
||||
etInputSpeed.setOnFocusChangeListener { v, hasFocus ->
|
||||
when {
|
||||
hasFocus -> {
|
||||
llSpeedPosition.background = resources.getDrawable(R.drawable.pilot_speed_high_light_bg)
|
||||
llSpeedPosition.background =
|
||||
resources.getDrawable(R.drawable.pilot_speed_high_light_bg)
|
||||
if (keyBoardUtil == null) {
|
||||
keyBoardUtil = KeyBoardUtil(sKeyBoardView, etInputSpeed)
|
||||
}
|
||||
keyBoardUtil?.showKeyboard()
|
||||
}
|
||||
else -> llSpeedPosition.background = resources.getDrawable(R.drawable.pilot_speed_bg)
|
||||
else -> llSpeedPosition.background =
|
||||
resources.getDrawable(R.drawable.pilot_speed_bg)
|
||||
}
|
||||
}
|
||||
etInputSpeed.setOnTouchListener { v, event ->
|
||||
@@ -150,28 +153,16 @@ class AutoPilotAndCheckView @JvmOverloads constructor(
|
||||
this.clickListener = clickListener
|
||||
}
|
||||
|
||||
/**
|
||||
* Bus不可设置自动驾驶速度,而Taxi可以
|
||||
*/
|
||||
private fun updateSpeedSettingViews() {
|
||||
when {
|
||||
AppIdentityModeUtils.isBus(FunctionBuildConfig.appIdentityMode) -> {
|
||||
tvSpeedTitle.visibility = View.GONE
|
||||
llSpeedPosition.visibility = View.GONE
|
||||
}
|
||||
else -> {
|
||||
tvSpeedTitle.visibility = View.VISIBLE
|
||||
llSpeedPosition.visibility = View.VISIBLE
|
||||
}
|
||||
}
|
||||
tvSpeedTitle.visibility = View.VISIBLE
|
||||
llSpeedPosition.visibility = View.VISIBLE
|
||||
}
|
||||
|
||||
fun showAdUpgradeStatus(ipcUpgradeStateInfo: IPCUpgradeStateInfo){
|
||||
fun showAdUpgradeStatus(ipcUpgradeStateInfo: IPCUpgradeStateInfo) {
|
||||
systemVersionView?.showAdUpgradeStatus(ipcUpgradeStateInfo)
|
||||
}
|
||||
|
||||
|
||||
|
||||
override fun onAttachedToWindow() {
|
||||
super.onAttachedToWindow()
|
||||
CallerAutoPilotStatusListenerManager.addListener(TAG, this)
|
||||
|
||||
@@ -5,16 +5,19 @@ import android.util.AttributeSet
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import com.mogo.cloud.passport.MoGoAiCloudClientConfig
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotStatusInfo
|
||||
import com.mogo.eagle.core.data.bindingcar.AdUpgradeStateHelper
|
||||
import com.mogo.eagle.core.data.bindingcar.IPCUpgradeStateInfo
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_HMI
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener
|
||||
import com.mogo.eagle.core.function.api.bindingcar.IMoGoBindingCarListener
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager
|
||||
import com.mogo.eagle.core.function.call.bindingcar.CallerBindingCarListenerManager
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.function.call.bindingcar.CallerBindingcarManager
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.Logger
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_HMI
|
||||
import com.mogo.eagle.core.utilcode.util.AppUtils
|
||||
import com.mogo.eagle.core.utilcode.util.ThreadUtils
|
||||
import com.mogo.eagle.core.utilcode.util.ToastUtils
|
||||
@@ -58,7 +61,10 @@ class SystemVersionView @JvmOverloads constructor(
|
||||
//鹰眼版本视图点击事件
|
||||
ivPadVersion.setOnClickListener {
|
||||
CallerLogger.i("$M_HMI$$TAG", "pad version view clicked")
|
||||
CallerBindingcarManager.getBindingcarProvider().queryAppUpgrade()
|
||||
}
|
||||
|
||||
|
||||
//工控机版本视图点击事件
|
||||
ivAdVersion.setOnClickListener {
|
||||
CallerLogger.i("$M_HMI$$TAG", "ad version view clicked")
|
||||
|
||||
@@ -216,7 +216,7 @@ public class MainActivity extends MvpActivity<MainView, MainPresenter> implement
|
||||
}
|
||||
new StartupManager.Builder()
|
||||
.addStartup(new AutopilotStartup())
|
||||
.addStartup(new APMStartup())
|
||||
// .addStartup(new APMStartup())
|
||||
.setConfig(config)
|
||||
.build(this)
|
||||
.start()
|
||||
|
||||
@@ -6,6 +6,7 @@ import android.content.Context;
|
||||
import android.os.Process;
|
||||
|
||||
import com.bytedance.boost_multidex.BoostMultiDex;
|
||||
import com.elegant.utils.UiThreadHandler;
|
||||
import com.mogo.cloud.passport.MoGoAiCloudClientConfig;
|
||||
import com.mogo.cloud.socket.SocketBuildConfig;
|
||||
import com.mogo.commons.AbsMogoApplication;
|
||||
@@ -13,6 +14,7 @@ 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.call.bindingcar.CallerBindingcarManager;
|
||||
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager;
|
||||
import com.mogo.eagle.core.function.notice.PushUIConstants;
|
||||
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils;
|
||||
@@ -51,6 +53,9 @@ public abstract class MainMoGoApplication extends AbsMogoApplication {
|
||||
initLogConfig();
|
||||
initTipToast();
|
||||
initModules();
|
||||
|
||||
//查询是否有版本的更新
|
||||
queryAppUpgrade();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -59,6 +64,15 @@ public abstract class MainMoGoApplication extends AbsMogoApplication {
|
||||
return ProcessUtils.isMainProcess(this);
|
||||
}
|
||||
|
||||
private void queryAppUpgrade() {
|
||||
UiThreadHandler.postDelayed(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
CallerBindingcarManager.getBindingcarProvider().queryAppUpgrade();
|
||||
}
|
||||
},3000);
|
||||
}
|
||||
|
||||
/**
|
||||
* 初始化异常采集配置
|
||||
*/
|
||||
|
||||
@@ -30,11 +30,11 @@ public class AutopilotStartup extends AndroidStartup<Boolean> {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public List<String> dependenciesByName() {
|
||||
List<String> deps = new ArrayList<>();
|
||||
deps.add("com.mogo.eagle.core.function.main.stagetwo.APMStartup");
|
||||
return deps;
|
||||
}
|
||||
// @Nullable
|
||||
// @Override
|
||||
// public List<String> dependenciesByName() {
|
||||
// List<String> deps = new ArrayList<>();
|
||||
// deps.add("com.mogo.eagle.core.function.main.stagetwo.APMStartup");
|
||||
// return deps;
|
||||
// }
|
||||
}
|
||||
|
||||
@@ -28,11 +28,11 @@ public class MapStartup extends AndroidStartup<Boolean> {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public List<String> dependenciesByName() {
|
||||
List<String> deps = new ArrayList<>();
|
||||
deps.add("com.mogo.eagle.core.function.main.stagetwo.APMStartup");
|
||||
return deps;
|
||||
}
|
||||
// @Nullable
|
||||
// @Override
|
||||
// public List<String> dependenciesByName() {
|
||||
// List<String> deps = new ArrayList<>();
|
||||
// deps.add("com.mogo.eagle.core.function.main.stagetwo.APMStartup");
|
||||
// return deps;
|
||||
// }
|
||||
}
|
||||
|
||||
@@ -0,0 +1,80 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<com.mogo.eagle.core.widget.RoundConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="840px"
|
||||
android:layout_height="470px"
|
||||
android:background="@color/dialog_bg_color"
|
||||
app:roundLayoutRadius="32px">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_upgrade_title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="50px"
|
||||
android:text="@string/application_upgrade"
|
||||
android:textColor="#FFFFFFFF"
|
||||
android:textSize="56px"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_upgrade_tips"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="50px"
|
||||
android:text="@string/application_upgrade_confirm"
|
||||
android:textColor="#FFFFFFFF"
|
||||
android:textSize="43px"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/tv_upgrade_title" />
|
||||
|
||||
<View
|
||||
android:id="@+id/view_horizontal_line"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="2px"
|
||||
android:layout_marginTop="80px"
|
||||
android:background="#66B8BFE8"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/tv_upgrade_tips" />
|
||||
|
||||
<View
|
||||
android:id="@+id/view_vertical_line"
|
||||
android:layout_width="3px"
|
||||
android:layout_height="0dp"
|
||||
android:background="#66B8BFE8"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/view_horizontal_line" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_upgrade_confirm"
|
||||
android:layout_width="400px"
|
||||
android:layout_height="100px"
|
||||
android:gravity="center"
|
||||
android:text="@string/confirm"
|
||||
android:textColor="#FFFFFFFF"
|
||||
android:textSize="46px"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toLeftOf="@id/view_vertical_line"
|
||||
app:layout_constraintTop_toBottomOf="@id/view_horizontal_line" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_upgrade_cancel"
|
||||
android:layout_width="400px"
|
||||
android:layout_height="100px"
|
||||
android:gravity="center"
|
||||
android:text="@string/cancel"
|
||||
android:textColor="#FFFFFFFF"
|
||||
android:textSize="46px"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toRightOf="@id/view_vertical_line"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/view_horizontal_line" />
|
||||
|
||||
|
||||
</com.mogo.eagle.core.widget.RoundConstraintLayout>
|
||||
@@ -1112,13 +1112,13 @@
|
||||
app:layout_constraintTop_toTopOf="@id/btnConnectServerIp" />
|
||||
|
||||
<ToggleButton
|
||||
android:id="@+id/tbWarningTone"
|
||||
android:id="@+id/tbReportWarning"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="@dimen/dp_10"
|
||||
android:textColor="#000"
|
||||
android:textOff="开启异常上报语音提示"
|
||||
android:textOn="关闭异常上报语音提示"
|
||||
android:textOff="开启异常上报提示"
|
||||
android:textOn="关闭异常上报提示"
|
||||
android:textSize="@dimen/dp_24"
|
||||
app:layout_constraintTop_toBottomOf="@id/btnConnectServerIp"
|
||||
/>
|
||||
@@ -1257,6 +1257,17 @@
|
||||
android:textOn="关闭「加速度面板」"
|
||||
android:textSize="@dimen/dp_24" />
|
||||
|
||||
<ToggleButton
|
||||
android:id="@+id/tbRouteDynamicEffect"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_columnWeight="1"
|
||||
android:layout_margin="2dp"
|
||||
android:gravity="center"
|
||||
android:textOff="开启「引导线动态效果」"
|
||||
android:textOn="关闭「引导线动态效果」"
|
||||
android:textSize="@dimen/dp_24" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatEditText
|
||||
android:id="@+id/etThreshold"
|
||||
android:layout_width="wrap_content"
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.mogo.eagle.core.function.map.identify
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import androidx.collection.ArraySet
|
||||
import com.mogo.commons.AbsMogoApplication
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig
|
||||
import com.mogo.eagle.core.data.enums.TrafficTypeEnum
|
||||
@@ -37,7 +38,7 @@ class IdentifyOriginDataDrawer : Identify {
|
||||
/**
|
||||
* 记录每次实际绘制的交通元素UUID
|
||||
*/
|
||||
private val trafficDataUuidList = ArrayList<String>()
|
||||
private val trafficDataUuidList = ArraySet<String>()
|
||||
|
||||
/**
|
||||
* 过滤后的数据集合
|
||||
@@ -111,6 +112,8 @@ class IdentifyOriginDataDrawer : Identify {
|
||||
trafficDataUuidList.forEach(Consumer { uuid: String ->
|
||||
mMarkersCaches.remove(uuid)
|
||||
algoCache.remove(uuid)
|
||||
MogoMarkerManager.getInstance(AbsMogoApplication.getApp())
|
||||
.removeMarker(uuid)
|
||||
})
|
||||
val filterList = filterTrafficData(resultList)
|
||||
if (filterList.size > 0) {
|
||||
|
||||
@@ -5,6 +5,7 @@ import android.util.ArrayMap;
|
||||
import android.util.Log;
|
||||
|
||||
import androidx.annotation.RequiresApi;
|
||||
import androidx.collection.ArraySet;
|
||||
|
||||
import com.google.common.collect.BiMap;
|
||||
import com.google.common.collect.HashBiMap;
|
||||
@@ -13,10 +14,10 @@ import com.mogo.eagle.core.data.config.FunctionBuildConfig;
|
||||
import com.mogo.eagle.core.data.enums.TrafficTypeEnum;
|
||||
import com.mogo.map.MogoMarkerManager;
|
||||
|
||||
import java.text.DecimalFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import mogo.telematics.pad.MessagePad;
|
||||
|
||||
@@ -30,8 +31,6 @@ public class TrackManager {
|
||||
return TrackOwner.trackManager;
|
||||
}
|
||||
|
||||
public static final DecimalFormat DF = new DecimalFormat("0.000000");
|
||||
public static final int DISTANCE = 6371000;
|
||||
public static double LIMIT_SPEED = 0.5;
|
||||
|
||||
/**
|
||||
@@ -44,12 +43,12 @@ public class TrackManager {
|
||||
*/
|
||||
private final BiMap<String, Long> cellIdCaches = HashBiMap.create();
|
||||
|
||||
private final ArrayMap<String, TrackObj> recentCaches = new ArrayMap<>();
|
||||
// private final ArrayMap<String, TrackObj> recentCaches = new ArrayMap<>();
|
||||
|
||||
/**
|
||||
* 记录每次实际绘制的交通元素UUID
|
||||
*/
|
||||
private final ArrayList<String> trafficDataUuidList = new ArrayList<>();
|
||||
private final Set<String> trafficDataUuidList = new ArraySet<>();
|
||||
|
||||
/**
|
||||
* 过滤后的数据集合
|
||||
@@ -59,6 +58,7 @@ public class TrackManager {
|
||||
public ArrayList<MessagePad.TrackedObject> filterTrafficData(List<MessagePad.TrackedObject> trafficData) {
|
||||
//清空上次返回数据,做到缓存复用
|
||||
mFilterTrafficData.clear();
|
||||
trafficDataUuidList.clear();
|
||||
//进入过滤机制的感知物体,首先从缓存队列中进行查找 uuid
|
||||
for (MessagePad.TrackedObject data : trafficData) {
|
||||
|
||||
@@ -75,20 +75,30 @@ public class TrackManager {
|
||||
mFilterTrafficData.add(data);
|
||||
} else {
|
||||
trackObj = new TrackObj(data);
|
||||
// 判断是否有重合元素 google s2
|
||||
// 融合逻辑 : 判断是否有重合元素 google s2
|
||||
if (cellIdCaches.containsValue(trackObj.getCellIdPos())) {
|
||||
String findSameValue = cellIdCaches.inverse().get(trackObj.getCellIdPos());
|
||||
if (data.getUuid() - Integer.parseInt(findSameValue) > 0) {
|
||||
// Log.d("0609", "uuid : " + findSameValue + " 与新感知物 : " + uuid + " , 出现相同pos : " + trackObj.getCellIdPos());
|
||||
uuid = findSameValue;
|
||||
data = data.toBuilder().setUuid(Integer.parseInt(findSameValue)).build();
|
||||
data = trackObj.updateObj(data);
|
||||
mFilterTrafficData.add(data);
|
||||
Log.d("hy uuid : " + findSameValue, " 与新感知物 : " + uuid + "相同");
|
||||
//uuid处理
|
||||
data = data.toBuilder().setUuid(Integer.parseInt(findSameValue)).build();
|
||||
MessagePad.TrackedObject cache = mMarkersCaches.get(findSameValue).getCache();
|
||||
if (cache != null) {
|
||||
//相对静止物体不改变
|
||||
TrackObj cacheTrack = mMarkersCaches.get(findSameValue);
|
||||
if (cacheTrack.relativeStatic()) {
|
||||
data = cache;
|
||||
trackObj = cacheTrack;
|
||||
}
|
||||
//todo OBU相关后面通过增加字段判断数据来源进行融合,不融合衡阳验收分支功能
|
||||
}
|
||||
uuid = findSameValue;
|
||||
data = trackObj.updateObj(data);
|
||||
mFilterTrafficData.add(data);
|
||||
}
|
||||
}
|
||||
cellIdCaches.forcePut(uuid, trackObj.getCellIdPos());
|
||||
mMarkersCaches.put(uuid, trackObj);
|
||||
Log.d("hy uuid : " + uuid, " 显示物体,塞入set");
|
||||
trafficDataUuidList.add(uuid);
|
||||
}
|
||||
//todo 将上次没被删除掉物体加入集合,造成延迟删除,对运动物体不友好
|
||||
@@ -121,8 +131,8 @@ public class TrackManager {
|
||||
}
|
||||
}
|
||||
trafficDataUuidList.forEach(uuid -> {
|
||||
mMarkersCaches.remove(uuid);
|
||||
cellIdCaches.remove(uuid);
|
||||
Log.d("hy uuid : " + uuid, " 移除物体");
|
||||
removeKey(uuid);
|
||||
});
|
||||
//todo bus存在时间回溯,将id重置,会有id复用问题,导致鹰眼展示元素缺少
|
||||
// Iterator it = mMarkersCaches.keySet().iterator();
|
||||
@@ -142,16 +152,20 @@ public class TrackManager {
|
||||
// }
|
||||
}
|
||||
|
||||
public void removeKey(String key) {
|
||||
mMarkersCaches.remove(key);
|
||||
cellIdCaches.remove(key);
|
||||
// recentCaches.remove(key);
|
||||
MogoMarkerManager.getInstance(AbsMogoApplication.getApp())
|
||||
.removeMarker(key);
|
||||
}
|
||||
|
||||
public void clearAll() {
|
||||
trafficDataUuidList.clear();
|
||||
Iterator it = mMarkersCaches.keySet().iterator();
|
||||
while (it.hasNext()) {
|
||||
String key = (String) it.next();
|
||||
mMarkersCaches.remove(key);
|
||||
cellIdCaches.remove(key);
|
||||
recentCaches.remove(key);
|
||||
MogoMarkerManager.getInstance(AbsMogoApplication.getApp())
|
||||
.removeMarker(key);
|
||||
removeKey(key);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,14 +1,19 @@
|
||||
package com.mogo.eagle.core.function.map.identify;
|
||||
|
||||
import static com.mogo.eagle.core.function.map.identify.TrackManager.DISTANCE;
|
||||
import static com.mogo.eagle.core.function.map.identify.TrackManager.LIMIT_SPEED;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.util.Log;
|
||||
|
||||
import com.mogo.eagle.core.data.enums.TrafficTypeEnum;
|
||||
import com.mogo.eagle.core.data.map.CenterLine;
|
||||
import com.mogo.eagle.core.function.call.map.CallerHDMapManager;
|
||||
import com.mogo.eagle.core.utilcode.geometry.S2CellId;
|
||||
import com.mogo.eagle.core.utilcode.geometry.S2LatLng;
|
||||
import com.mogo.module.service.Utils;
|
||||
import com.mogo.eagle.core.data.map.CenterLine;
|
||||
import com.mogo.map.utils.PointInterpolatorUtil;
|
||||
import com.zhidaoauto.map.sdk.open.data.MapDataApi;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import mogo.telematics.pad.MessagePad;
|
||||
@@ -22,12 +27,12 @@ public class TrackObj {
|
||||
private long recentlyTime; //用于缓存帧数判断,暂定缓存1秒数据,中间如果有物体未出现,1秒后删除
|
||||
private double roadAngle; //道路航向
|
||||
private double headingDelta; //航向角德尔塔
|
||||
private int[] typeArray = new int[5];
|
||||
private double typeWeight; //类型权重
|
||||
private double lat;
|
||||
private double lon;
|
||||
private double speedAverage;
|
||||
// private SinglePointRoadInfo singlePointRoadInfo;
|
||||
// private double[] matchedPoint;
|
||||
private com.zhidaoauto.map.sdk.open.road.CenterLine centerLineInfo = null;
|
||||
|
||||
public TrackObj(MessagePad.TrackedObject data) {
|
||||
kalmanFilter = new KalmanFilter(data.getLongitude(), data.getLatitude(), 0.0000005);
|
||||
@@ -58,93 +63,72 @@ public class TrackObj {
|
||||
}
|
||||
|
||||
private void correct() {
|
||||
calAverageSpeed();
|
||||
calAverageSpeedAndType();
|
||||
calLoc();
|
||||
calHeading();
|
||||
calType();
|
||||
}
|
||||
|
||||
private void calAverageSpeed() {
|
||||
//计算平均速度
|
||||
@SuppressLint("NewApi")
|
||||
private void calAverageSpeedAndType() {
|
||||
|
||||
if (circleQueue.size() >= 5) {
|
||||
//计算平均速度
|
||||
List<ObjQueue> objQueueList = circleQueue.getLastFiveFrame();
|
||||
speedAverage = (objQueueList.get(0).getSpeed() + objQueueList.get(1).getSpeed() + objQueueList.get(2).getSpeed() + objQueueList.get(3).getSpeed() + objQueueList.get(4).getSpeed()) / 5;
|
||||
//计算类型
|
||||
typeArray[0] = objQueueList.get(0).getType();
|
||||
typeArray[1] = objQueueList.get(1).getType();
|
||||
typeArray[2] = objQueueList.get(2).getType();
|
||||
typeArray[3] = objQueueList.get(3).getType();
|
||||
typeArray[4] = objQueueList.get(4).getType();
|
||||
} else {
|
||||
double cal = 0;
|
||||
List<ObjQueue> objQueueList = circleQueue.getPreFrame();
|
||||
for (ObjQueue obj : objQueueList) {
|
||||
cal += obj.getSpeed();
|
||||
for (int i = 0; i < objQueueList.size() - 1; i++) {
|
||||
cal += objQueueList.get(i).getSpeed();
|
||||
typeArray[i] = objQueueList.get(i).getType();
|
||||
}
|
||||
speedAverage = cal / objQueueList.size();
|
||||
// speedAverage = circleQueue.getLastFrame().getSpeed();
|
||||
}
|
||||
Log.d("hy uuid : " + cacheData.getUuid()," 类型 : " + Arrays.toString(typeArray));
|
||||
typeArray = Arrays.stream(typeArray).sorted().toArray();
|
||||
typeWeight = typeArray[typeArray.length / 2];
|
||||
}
|
||||
|
||||
private void calLoc() {
|
||||
//距离计算,位置修正
|
||||
//todo bus250 taxi上测试下面注释掉内容
|
||||
//double[] lonLat = kalmanFilter.filter(cacheData.getLongitude(), cacheData.getLatitude());
|
||||
// double distance = s2LatLng.getDistance(S2LatLng.fromDegrees(lonLat[1], lonLat[0])).distance(DISTANCE);
|
||||
// double distance = s2LatLng.getDistance(S2LatLng.fromDegrees(cacheData.getLatitude(), cacheData.getLongitude())).distance(DISTANCE);
|
||||
//todo 重新计算速度值(如果连续几帧distance累加到一定值,速度没变化,需要重新计算速度,防止锁死)
|
||||
// if (relativeStatic()) {
|
||||
// double tempDis = distance;
|
||||
// if (distance >= 4) { //(150km/h) 41.6m/s x 0.1s = 4.16m 约等于 4
|
||||
// tempDis = 4;
|
||||
// }
|
||||
// double calSpeed = cacheData.getSpeed();
|
||||
// if (cacheData.getSpeed() != 0.0) {
|
||||
// calSpeed = tempDis / ((Double.valueOf(cacheData.getSatelliteTime() * 1000).longValue() - recentlyTime) / 1000.0);
|
||||
//// Log.d("calSpeed uuid : " + cacheData.getUuid(), " tempDis : " + tempDis + " , 重新赋值 calSpeed : " + DF.format(calSpeed) + " , time : " + (Double.valueOf(cacheData.getSatelliteTime() * 1000).longValue() - recentlyTime) + " , 原速度 : " + cacheData.getSpeed());
|
||||
// if (calSpeed > cacheData.getSpeed()) {
|
||||
// calSpeed = cacheData.getSpeed();
|
||||
//// Log.d("calSpeed uuid : " + cacheData.getUuid(), " 二次重新赋值 calSpeed : " + DF.format(calSpeed));
|
||||
// }
|
||||
//// if (calSpeed > 2) {
|
||||
//// calSpeed = 2;
|
||||
////// Log.d("calSpeed uuid : " + cacheData.getUuid(), " 三次重新赋值 calSpeed : " + DF.format(calSpeed));
|
||||
//// }
|
||||
// }
|
||||
// cacheData = cacheData.toBuilder().setSpeed(calSpeed).build();
|
||||
// }
|
||||
//todo 等后序速度优化结果值可用,使用计算结果
|
||||
// double calDistance = (cacheData.getSpeed() * (Double.valueOf(cacheData.getSatelliteTime() * 1000).longValue() - recentlyTime)) / 1000.0;
|
||||
// double calDistance = Utils.calculateLineDistance(lon, lat, cacheData.getLongitude(), cacheData.getLatitude());
|
||||
// Log.d("calLoc uuid : " + cacheData.getUuid() + " calDistance : " + DF.format(calDistance), (calDistance * 2 < distance) ? "超出范围" : "正常值");
|
||||
//速度小于0.5m/s,并且距离在计算合理范围内超出2倍,则认为是相对静止状态(注意调整阈值),不更新缓存点信息
|
||||
// if (cacheData.getSpeed() < LIMIT_SPEED || relativeStatic() || calDistance * 2 < distance) {
|
||||
if (relativeStatic()) {
|
||||
// if (singlePointRoadInfo == null) {
|
||||
// double angle = roadAngle != 0 ? roadAngle : cacheData.getHeading();
|
||||
// long cost = System.nanoTime();
|
||||
// singlePointRoadInfo = MapDataApi.INSTANCE.getSinglePointMatchRoad(lon, lat, (float) angle, true, true);
|
||||
// Log.d("hy create cost", " " + (System.nanoTime() - cost) / 1000000);
|
||||
// }
|
||||
// if (singlePointRoadInfo != null && singlePointRoadInfo.getCoords() != null && !singlePointRoadInfo.getCoords().isEmpty()) {
|
||||
// if(matchedPoint == null || matchedPoint.length == 0){
|
||||
// long cost = System.nanoTime();
|
||||
// matchedPoint = PointInterpolatorUtil.mergeToRoad(cacheData.getLongitude(), cacheData.getLatitude(), singlePointRoadInfo.getCoords());
|
||||
// Log.d("hy matchedPoint cost", " " + (System.nanoTime() - cost) / 1000000);
|
||||
// Log.d("hy uuid : " + cacheData.getUuid(), "道路经纬度 lon : " + matchedPoint[0] + " lat : " + matchedPoint[1] + " distance : " + matchedPoint[2] + " , 原数据 lon : " + lon + " lat : " + lat);
|
||||
// }else{
|
||||
// if(matchedPoint[0] == 0 || matchedPoint[1] == 0){
|
||||
// cacheData = cacheData.toBuilder().setLongitude(lon).setLatitude(lat).build();
|
||||
// }else{
|
||||
// cacheData = cacheData.toBuilder().setLongitude(matchedPoint[0]).setLatitude(matchedPoint[1]).build();
|
||||
// }
|
||||
// }
|
||||
// lat = matchedPoint[1];
|
||||
// lon = matchedPoint[0];
|
||||
// } else {
|
||||
// Log.d("hy uuid : " + cacheData.getUuid(), "未匹配到道路数据,使用原数据 lon : " + lon + " lat : " + lat);
|
||||
// }
|
||||
cacheData = cacheData.toBuilder().setLongitude(lon).setLatitude(lat).build();
|
||||
double angle = roadAngle != 0 ? roadAngle : cacheData.getHeading();
|
||||
if (centerLineInfo == null && isFourWheelType()) {
|
||||
centerLineInfo = MapDataApi.INSTANCE.getCenterLineInfo(lon, lat, (float) angle);
|
||||
if (centerLineInfo != null && centerLineInfo.getPoints() != null && !centerLineInfo.getPoints().isEmpty()) {
|
||||
double[] matchedPoint = PointInterpolatorUtil.mergeToRoad(cacheData.getLongitude(), cacheData.getLatitude(), centerLineInfo.getPoints());
|
||||
if (matchedPoint[0] > 0 || matchedPoint[1] > 0) {
|
||||
lon = matchedPoint[0];
|
||||
lat = matchedPoint[1];
|
||||
s2LatLng = S2LatLng.fromDegrees(cacheData.getLatitude(), cacheData.getLongitude());
|
||||
s2CellId = S2CellId.fromLatLng(s2LatLng).parent(22);
|
||||
Log.d("hy uuid : " + cacheData.getUuid(), " 更新定位 lon : " + matchedPoint[0] + " , lat : " + matchedPoint[1]);
|
||||
} else {
|
||||
centerLineInfo = null;
|
||||
Log.d("hy uuid : " + cacheData.getUuid(), "计算结果出现问题 : " + matchedPoint[0] + " , " + matchedPoint[1]);
|
||||
}
|
||||
} else {
|
||||
centerLineInfo = null;
|
||||
Log.d("hy uuid : " + cacheData.getUuid(), "未获取到道路数据");
|
||||
}
|
||||
}
|
||||
Log.d("hy uuid : " + cacheData.getUuid(), " 静止使用定位数据 lon : " + lon + " , lat : " + lat);
|
||||
cacheData = cacheData.toBuilder().setLongitude(lon).setLatitude(lat).build();
|
||||
} else {
|
||||
centerLineInfo = null;
|
||||
//不在阈值内则更新,代表物体移动,使用卡尔曼滤波经纬度数据
|
||||
//double[] lonLat = kalmanFilter.filter(cacheData.getLongitude(), cacheData.getLatitude());
|
||||
lat = cacheData.getLatitude();
|
||||
lon = cacheData.getLongitude();
|
||||
s2LatLng = S2LatLng.fromDegrees(cacheData.getLatitude(), cacheData.getLongitude());
|
||||
s2CellId = S2CellId.fromLatLng(s2LatLng).parent(22);
|
||||
Log.d("hy uuid : " + cacheData.getUuid(), " 开始移动 lon : " + lon + " , lat : " + lat);
|
||||
// cacheData = cacheData.toBuilder().setLongitude(lonLat[0]).setLatitude(lonLat[1]).build();
|
||||
}
|
||||
}
|
||||
@@ -193,15 +177,11 @@ public class TrackObj {
|
||||
}
|
||||
//速度大于LIMIT_SPEED并出现大幅度转向使用缓存帧和delta数据
|
||||
if (cacheData.getSpeed() >= LIMIT_SPEED && newDelta > 10 && headingDelta != 0.0) {
|
||||
// Log.i("0609", "uuid : " + cacheData.getUuid() + " 修正航向角 last : " + lastObj.getHeading() + " , 增益 : " + headingDelta);
|
||||
// Log.i("hy uuid : " + cacheData.getUuid() , " 修正航向角 last : " + lastObj.getHeading() + " , 增益 : " + headingDelta);
|
||||
cacheData = cacheData.toBuilder().setHeading(lastObj.getHeading() + headingDelta).build();
|
||||
}
|
||||
}
|
||||
|
||||
private void calType() {
|
||||
|
||||
}
|
||||
|
||||
public long getRecentlyTime() {
|
||||
return recentlyTime;
|
||||
}
|
||||
@@ -218,6 +198,12 @@ public class TrackObj {
|
||||
return speedAverage < LIMIT_SPEED;
|
||||
}
|
||||
|
||||
public boolean isFourWheelType() {
|
||||
return typeWeight != TrafficTypeEnum.TYPE_TRAFFIC_ID_PEOPLE.getType()
|
||||
|| typeWeight != TrafficTypeEnum.TYPE_TRAFFIC_ID_BICYCLE.getType()
|
||||
|| typeWeight != TrafficTypeEnum.TYPE_TRAFFIC_ID_MOTO.getType();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "TrackObj{" +
|
||||
|
||||
@@ -166,13 +166,17 @@ public class SmallMapDirectionView
|
||||
if (location == null) {
|
||||
return;
|
||||
}
|
||||
if (mCarMarker == null){
|
||||
mCarMarker = mAMap.addMarker(new MarkerOptions()
|
||||
.icon(BitmapDescriptorFactory.fromResource(R.drawable.module_small_map_view_my_location_logo))
|
||||
.anchor(0.5f, 0.5f));
|
||||
}
|
||||
if(mCarMarker == null){
|
||||
return;
|
||||
}
|
||||
LatLng currentLatLng = new LatLng(location.getLatitude(), location.getLongitude());
|
||||
//更新车辆位置
|
||||
if (mCarMarker != null) {
|
||||
// mCarMarker.setRotateAngle(location.getBearing());
|
||||
mCarMarker.setPosition(currentLatLng);
|
||||
// mCarMarker.setToTop();
|
||||
}
|
||||
mCarMarker.setPosition(currentLatLng);
|
||||
|
||||
CameraPosition cameraPosition;
|
||||
if (mCoordinatesLatLng.size() > 1) {
|
||||
|
||||
@@ -466,7 +466,6 @@ object V2XEventManager : IMoGoMapLocationListener, IMoGoTokenCallback, IV2XCallb
|
||||
l3.location = V2XMarkerLocation().also { l4 ->
|
||||
l4.lat = this.roadwork?.center?.point?.lat ?: 0.0
|
||||
l4.lon = this.roadwork?.center?.point?.lon ?: 0.0
|
||||
l4.angle = -1.0
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
@@ -48,7 +48,7 @@ public class V2XAlarmServer {
|
||||
// 因为集合是按照距离排序后的所以这里检索出来第一个就发出警告
|
||||
for (V2XRoadEventEntity v2XRoadEventEntity : v2XRoadEventEntityList) {
|
||||
// 0、道路事件必须有朝向,角度>=0;
|
||||
boolean ignoreAngle = v2XRoadEventEntity.getLocation().getAngle() < 0;
|
||||
boolean ignoreAngle = EventTypeEnum.AI_ROAD_WORK.getPoiType().equals(v2XRoadEventEntity.getPoiType());
|
||||
if (v2XRoadEventEntity.getLocation().getAngle() >= 0 || ignoreAngle) {
|
||||
// 计算车辆距离指定气泡的距离
|
||||
MarkerLocation eventLocation = v2XRoadEventEntity.getLocation();
|
||||
|
||||
@@ -0,0 +1,137 @@
|
||||
package com.mogo.eagle.core.data.bindingcar;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @author lixiaopeng
|
||||
* @description
|
||||
* @since 6/21/22
|
||||
*/
|
||||
public class AppInfo implements Serializable {
|
||||
private IdInfo _id;
|
||||
private int bk_inst_id;
|
||||
private String bk_inst_name;
|
||||
private String bk_supplier_account;
|
||||
private String screen_type; //1,司机屏,2乘客屏
|
||||
private String sn;
|
||||
private String last_time;
|
||||
private String app_url;
|
||||
private String bk_obj_id;
|
||||
private int version_code;
|
||||
private String version_name;
|
||||
private String create_time;
|
||||
|
||||
public IdInfo get_id() {
|
||||
return _id;
|
||||
}
|
||||
|
||||
public void set_id(IdInfo _id) {
|
||||
this._id = _id;
|
||||
}
|
||||
|
||||
public int getBk_inst_id() {
|
||||
return bk_inst_id;
|
||||
}
|
||||
|
||||
public void setBk_inst_id(int bk_inst_id) {
|
||||
this.bk_inst_id = bk_inst_id;
|
||||
}
|
||||
|
||||
public String getBk_inst_name() {
|
||||
return bk_inst_name;
|
||||
}
|
||||
|
||||
public void setBk_inst_name(String bk_inst_name) {
|
||||
this.bk_inst_name = bk_inst_name;
|
||||
}
|
||||
|
||||
public String getBk_supplier_account() {
|
||||
return bk_supplier_account;
|
||||
}
|
||||
|
||||
public void setBk_supplier_account(String bk_supplier_account) {
|
||||
this.bk_supplier_account = bk_supplier_account;
|
||||
}
|
||||
|
||||
public String getScreen_type() {
|
||||
return screen_type;
|
||||
}
|
||||
|
||||
public void setScreen_type(String screen_type) {
|
||||
this.screen_type = screen_type;
|
||||
}
|
||||
|
||||
public String getSn() {
|
||||
return sn;
|
||||
}
|
||||
|
||||
public void setSn(String sn) {
|
||||
this.sn = sn;
|
||||
}
|
||||
|
||||
public String getApp_url() {
|
||||
return app_url;
|
||||
}
|
||||
|
||||
public void setApp_url(String app_url) {
|
||||
this.app_url = app_url;
|
||||
}
|
||||
|
||||
public String getBk_obj_id() {
|
||||
return bk_obj_id;
|
||||
}
|
||||
|
||||
public void setBk_obj_id(String bk_obj_id) {
|
||||
this.bk_obj_id = bk_obj_id;
|
||||
}
|
||||
|
||||
public int getVersion_code() {
|
||||
return version_code;
|
||||
}
|
||||
|
||||
public void setVersion_code(int version_code) {
|
||||
this.version_code = version_code;
|
||||
}
|
||||
|
||||
public String getVersion_name() {
|
||||
return version_name;
|
||||
}
|
||||
|
||||
public void setVersion_name(String version_name) {
|
||||
this.version_name = version_name;
|
||||
}
|
||||
|
||||
public String getLast_time() {
|
||||
return last_time;
|
||||
}
|
||||
|
||||
public void setLast_time(String last_time) {
|
||||
this.last_time = last_time;
|
||||
}
|
||||
|
||||
public String getCreate_time() {
|
||||
return create_time;
|
||||
}
|
||||
|
||||
public void setCreate_time(String create_time) {
|
||||
this.create_time = create_time;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "AppInfo{" +
|
||||
"_id=" + _id +
|
||||
", bk_inst_id='" + bk_inst_id + '\'' +
|
||||
", bk_inst_name='" + bk_inst_name + '\'' +
|
||||
", bk_supplier_account='" + bk_supplier_account + '\'' +
|
||||
", screen_type=" + screen_type +
|
||||
", sn='" + sn + '\'' +
|
||||
", last_time=" + last_time +
|
||||
", app_url='" + app_url + '\'' +
|
||||
", bk_obj_id='" + bk_obj_id + '\'' +
|
||||
", version_code=" + version_code +
|
||||
", version_name='" + version_name + '\'' +
|
||||
", create_time=" + create_time +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.mogo.eagle.core.data.bindingcar;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author lixiaopeng
|
||||
* @description
|
||||
* @since 6/21/22
|
||||
*/
|
||||
public class IdInfo implements Serializable {
|
||||
private long timestamp;
|
||||
private String date;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package com.mogo.eagle.core.data.bindingcar;
|
||||
|
||||
import com.mogo.eagle.core.data.BaseData;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
/**
|
||||
* @author lixiaopeng
|
||||
* @description app升级管理
|
||||
* @since: 6/21/22
|
||||
*/
|
||||
public class UpgradeAppInfo extends BaseData {
|
||||
public ArrayList<AppInfo> data;
|
||||
|
||||
public ArrayList<AppInfo> getData() {
|
||||
return data;
|
||||
}
|
||||
|
||||
public void setData(ArrayList<AppInfo> data) {
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "UpgradeAppInfo{" +
|
||||
"data=" + data +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
@@ -118,10 +118,10 @@ object FunctionBuildConfig {
|
||||
var skinMode = 0
|
||||
|
||||
/**
|
||||
* 异常上报是否有语音提示
|
||||
* 是否进行异常上报提示
|
||||
*/
|
||||
@Volatile
|
||||
@JvmField
|
||||
var isWarningTone = true
|
||||
var isReportWarning = true
|
||||
|
||||
}
|
||||
@@ -10,7 +10,17 @@ import java.util.List;
|
||||
* @since: 3/15/22
|
||||
*/
|
||||
public interface IMoGoBindingcarProvider extends IMoGoFunctionServerProvider {
|
||||
/**
|
||||
* 修改工控机的绑定关系
|
||||
* @param callBack
|
||||
*/
|
||||
void modifyCarInfo(BindingcarCallBack callBack);
|
||||
|
||||
/**
|
||||
* 获取车辆的信息
|
||||
* @param macAddress
|
||||
* @param widevineIDWithMd5
|
||||
*/
|
||||
void getBindingcarInfo(String macAddress, String widevineIDWithMd5);
|
||||
|
||||
/**
|
||||
@@ -27,4 +37,10 @@ public interface IMoGoBindingcarProvider extends IMoGoFunctionServerProvider {
|
||||
* @param dockerVersion 当前工控机版本
|
||||
*/
|
||||
void queryContainers(String padSn,String dockerVersion);
|
||||
|
||||
/**
|
||||
* 查询app是否有更新
|
||||
*/
|
||||
void queryAppUpgrade();
|
||||
|
||||
}
|
||||
|
||||
@@ -205,6 +205,11 @@ interface IMoGoWaringProvider : IMoGoHmiViewProxy {
|
||||
*/
|
||||
fun showModifyBindingcarDialog()
|
||||
|
||||
/**
|
||||
* 展示升级app弹框
|
||||
*/
|
||||
fun showUpgradeDialog(name: String, url: String)
|
||||
|
||||
/**
|
||||
* 呈现工控机升级确认框
|
||||
*/
|
||||
|
||||
@@ -167,11 +167,11 @@ object CallerAutoPilotStatusListenerManager : CallerBase() {
|
||||
*/
|
||||
@Synchronized
|
||||
fun invokeAutopilotGuardian(guardianInfo: MogoReportMsg.MogoReportMessage?) {
|
||||
// M_AUTOPILOT_STATUS_LISTENERS.forEach {
|
||||
// val listener = it.value
|
||||
// autoPilotMessageCode = guardianInfo?.code ?: ""
|
||||
// listener.onAutopilotGuardian(guardianInfo)
|
||||
// }
|
||||
M_AUTOPILOT_STATUS_LISTENERS.forEach {
|
||||
val listener = it.value
|
||||
autoPilotMessageCode = guardianInfo?.code ?: ""
|
||||
listener.onAutopilotGuardian(guardianInfo)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -269,6 +269,10 @@ object CallerHmiManager : CallerBase() {
|
||||
waringProviderApi?.showModifyBindingcarDialog()
|
||||
}
|
||||
|
||||
fun showUpgradeDialog(name: String, url: String) {
|
||||
waringProviderApi?.showUpgradeDialog(name, url)
|
||||
}
|
||||
|
||||
/**
|
||||
* 呈现工控机升级确认框
|
||||
*/
|
||||
|
||||
@@ -60,29 +60,29 @@ HOOK_LOG_VERSION=1.6.1
|
||||
SERVICE_CHAIN_VERSION=1.1.0
|
||||
################ 外部依赖引用 ################
|
||||
# loglib
|
||||
LOGLIB_VERSION=1.3.1
|
||||
LOGLIB_VERSION=1.3.2
|
||||
######## MogoAiCloudSDK Version ########
|
||||
# 网络请求LOGLIB_VERSION
|
||||
MOGO_NETWORK_VERSION=1.4.3.3
|
||||
MOGO_NETWORK_VERSION=1.4.3.6
|
||||
# 鉴权
|
||||
MOGO_PASSPORT_VERSION=1.4.3.3
|
||||
MOGO_PASSPORT_VERSION=1.4.3.6
|
||||
# 常链接
|
||||
MOGO_SOCKET_VERSION=1.4.3.3
|
||||
MOGO_SOCKET_VERSION=1.4.3.6
|
||||
# 数据采集
|
||||
MOGO_REALTIME_VERSION=1.4.3.3
|
||||
MOGO_REALTIME_VERSION=1.4.3.6
|
||||
# 探路,道路事件发布,获取
|
||||
MOGO_TANLU_VERSION=1.4.3.3
|
||||
MOGO_TANLU_VERSION=1.4.3.6
|
||||
# 直播推流
|
||||
MOGO_LIVE_VERSION=1.4.3.3
|
||||
MOGO_LIVE_VERSION=1.4.3.6
|
||||
# 直播拉流
|
||||
MOGO_TRAFFICLIVE_VERSION=1.4.3.3
|
||||
MOGO_TRAFFICLIVE_VERSION=1.4.3.6
|
||||
# 定位服务
|
||||
MOGO_LOCATION_VERSION=1.4.3.3
|
||||
MOGO_LOCATION_VERSION=1.4.3.6
|
||||
# 远程通讯模块
|
||||
MOGO_TELEMATIC_VERSION=1.4.3.3
|
||||
MOGO_TELEMATIC_VERSION=1.4.3.6
|
||||
######## MogoAiCloudSDK Version ########
|
||||
# 自研地图
|
||||
MAP_SDK_VERSION=2.2.0.9
|
||||
MAP_SDK_VERSION=2.2.1.1
|
||||
MAP_SDK_OPERATION_VERSION=1.0.13
|
||||
# websocket
|
||||
WEBSOCKET_VERSION=1.1.7
|
||||
@@ -155,7 +155,7 @@ MOGO_OCH_TAXI_VERSION=2.0.66
|
||||
# mogoAiCloud sdk services
|
||||
MOGO_AICLOUD_SERVICES_SDK_VERSION=2.1.16.10
|
||||
# v2x-sdk
|
||||
MOGO_V2X_SDK_VERSION=1.4.3.3
|
||||
MOGO_V2X_SDK_VERSION=1.4.3.6
|
||||
################# 旧版本架构模块版本 #################
|
||||
|
||||
|
||||
|
||||
@@ -22,5 +22,6 @@ public class HostConst {
|
||||
public static final String BINDING_SN_HOST = "https://mygateway.zhidaozhixing.com/cmdbapi/"; //中台提供的接口服务
|
||||
public static final String BINDING_SN_HOST_TEST = "https://mygateway.zhidaozhixing.com/cmdbapitest/"; //中台提供的接口服务测试
|
||||
|
||||
public static final String UPGRADE_APP_HOST = "http://10.0.200.12:32423?/";
|
||||
|
||||
}
|
||||
|
||||
@@ -32,6 +32,12 @@ enum class EventTypeEnum(
|
||||
"前方施工", "道路施工"
|
||||
),
|
||||
|
||||
//施工-AI云下发
|
||||
AI_ROAD_WORK(
|
||||
"100061", "道路施工", "前方施工", R.drawable.icon_warning_v2x_road_construction,
|
||||
"前方施工", "道路施工"
|
||||
),
|
||||
|
||||
//拥堵
|
||||
FOURS_BLOCK_UP(
|
||||
"10007", "道路拥堵", "前方拥堵", R.drawable.icon_warning_v2x_congestion,
|
||||
@@ -368,6 +374,7 @@ enum class EventTypeEnum(
|
||||
TRAFFIC_CHECK.poiType -> TRAFFIC_CHECK.poiTypeStr
|
||||
ROAD_CLOSED.poiType -> ROAD_CLOSED.poiTypeStr
|
||||
FOURS_ROAD_WORK.poiType -> FOURS_ROAD_WORK.poiTypeStr
|
||||
AI_ROAD_WORK.poiType -> AI_ROAD_WORK.poiTypeStr
|
||||
FOURS_BLOCK_UP.poiType -> FOURS_BLOCK_UP.poiTypeStr
|
||||
FOURS_PONDING.poiType -> FOURS_PONDING.poiTypeStr
|
||||
FOURS_FOG.poiType -> FOURS_FOG.poiTypeStr
|
||||
@@ -389,6 +396,7 @@ enum class EventTypeEnum(
|
||||
TRAFFIC_CHECK.poiType -> TRAFFIC_CHECK.poiTypeStrVr
|
||||
ROAD_CLOSED.poiType -> ROAD_CLOSED.poiTypeStrVr
|
||||
FOURS_ROAD_WORK.poiType -> FOURS_ROAD_WORK.poiTypeStrVr
|
||||
AI_ROAD_WORK.poiType -> AI_ROAD_WORK.poiTypeStrVr
|
||||
FOURS_BLOCK_UP.poiType -> FOURS_BLOCK_UP.poiTypeStrVr
|
||||
FOURS_PONDING.poiType -> FOURS_PONDING.poiTypeStrVr
|
||||
FOURS_FOG.poiType -> FOURS_FOG.poiTypeStrVr
|
||||
@@ -410,6 +418,7 @@ enum class EventTypeEnum(
|
||||
TRAFFIC_CHECK.poiType -> TRAFFIC_CHECK.poiTypeSrcVr
|
||||
ROAD_CLOSED.poiType -> ROAD_CLOSED.poiTypeSrcVr
|
||||
FOURS_ROAD_WORK.poiType -> FOURS_ROAD_WORK.poiTypeSrcVr
|
||||
AI_ROAD_WORK.poiType -> AI_ROAD_WORK.poiTypeSrcVr
|
||||
FOURS_BLOCK_UP.poiType -> FOURS_BLOCK_UP.poiTypeSrcVr
|
||||
FOURS_PONDING.poiType -> FOURS_PONDING.poiTypeSrcVr
|
||||
FOURS_FOG.poiType -> FOURS_FOG.poiTypeSrcVr
|
||||
@@ -431,7 +440,7 @@ enum class EventTypeEnum(
|
||||
fun getPoiTypeBg(poiType: String, isVrMode: Boolean): Int {
|
||||
return when (poiType) {
|
||||
FOURS_BLOCK_UP.poiType, FOURS_LIVING.poiType-> if (isVrMode) R.drawable.bg_v2x_event_type_orange_vr else R.drawable.bg_v2x_event_type_orange
|
||||
TRAFFIC_CHECK.poiType, ROAD_CLOSED.poiType, FOURS_ROAD_WORK.poiType,
|
||||
TRAFFIC_CHECK.poiType, ROAD_CLOSED.poiType, FOURS_ROAD_WORK.poiType,AI_ROAD_WORK.poiType,
|
||||
FOURS_PONDING.poiType, FOURS_FOG.poiType, FOURS_ICE.poiType, FOURS_ACCIDENT.poiType,
|
||||
FOURS_ACCIDENT_01.poiType, FOURS_ACCIDENT_02.poiType, FOURS_ACCIDENT_03.poiType,
|
||||
FOURS_ACCIDENT_04.poiType, FOURS_ACCIDENT_05.poiType -> if (isVrMode) R.drawable.bg_v2x_event_type_red_vr else R.drawable.bg_v2x_event_type_read
|
||||
@@ -447,7 +456,7 @@ enum class EventTypeEnum(
|
||||
FOURS_BLOCK_UP.poiType, FOURS_LIVING.poiType ->
|
||||
R.drawable.bg_v2x_event_type_orange
|
||||
TRAFFIC_CHECK.poiType, ROAD_CLOSED.poiType,
|
||||
FOURS_ROAD_WORK.poiType, FOURS_PONDING.poiType,
|
||||
FOURS_ROAD_WORK.poiType,AI_ROAD_WORK.poiType, FOURS_PONDING.poiType,
|
||||
FOURS_FOG.poiType, FOURS_ICE.poiType,
|
||||
FOURS_ACCIDENT.poiType, FOURS_ACCIDENT_01.poiType,
|
||||
FOURS_ACCIDENT_02.poiType, FOURS_ACCIDENT_03.poiType,
|
||||
@@ -464,12 +473,12 @@ enum class EventTypeEnum(
|
||||
fun isRoadEvent(poiType: String?): Boolean {
|
||||
return when (poiType) {
|
||||
TRAFFIC_CHECK.poiType, ROAD_CLOSED.poiType,
|
||||
FOURS_ROAD_WORK.poiType, FOURS_BLOCK_UP.poiType,
|
||||
FOURS_ROAD_WORK.poiType,AI_ROAD_WORK.poiType, FOURS_BLOCK_UP.poiType,
|
||||
FOURS_PONDING.poiType, FOURS_FOG.poiType,
|
||||
FOURS_ICE.poiType, FOURS_ACCIDENT.poiType,
|
||||
FOURS_ACCIDENT_01.poiType, FOURS_ACCIDENT_02.poiType,
|
||||
FOURS_ACCIDENT_03.poiType, FOURS_ACCIDENT_04.poiType,
|
||||
FOURS_ACCIDENT_05.poiType, GHOST_PROBE.poiType -> true
|
||||
FOURS_ACCIDENT_05.poiType, GHOST_PROBE.poiType, AI_ROAD_WORK.poiType -> true
|
||||
else -> false
|
||||
}
|
||||
}
|
||||
@@ -480,7 +489,7 @@ enum class EventTypeEnum(
|
||||
@JvmStatic
|
||||
fun isNeedRoadEventUgc(poiType: String?): Boolean {
|
||||
return when (poiType) {
|
||||
ROAD_CLOSED.poiType, FOURS_ROAD_WORK.poiType,
|
||||
ROAD_CLOSED.poiType, FOURS_ROAD_WORK.poiType,AI_ROAD_WORK.poiType,
|
||||
FOURS_BLOCK_UP.poiType, FOURS_ACCIDENT.poiType,
|
||||
FOURS_ACCIDENT_01.poiType, FOURS_ACCIDENT_02.poiType,
|
||||
FOURS_ACCIDENT_03.poiType, FOURS_ACCIDENT_04.poiType,
|
||||
@@ -496,6 +505,7 @@ enum class EventTypeEnum(
|
||||
TRAFFIC_CHECK.poiType -> TRAFFIC_CHECK.tts
|
||||
ROAD_CLOSED.poiType -> ROAD_CLOSED.tts
|
||||
FOURS_ROAD_WORK.poiType -> FOURS_ROAD_WORK.tts
|
||||
AI_ROAD_WORK.poiType -> AI_ROAD_WORK.tts
|
||||
FOURS_BLOCK_UP.poiType -> FOURS_BLOCK_UP.tts
|
||||
FOURS_PONDING.poiType -> FOURS_PONDING.tts
|
||||
FOURS_FOG.poiType -> FOURS_FOG.tts
|
||||
@@ -512,6 +522,7 @@ enum class EventTypeEnum(
|
||||
TRAFFIC_CHECK.poiType -> "交通检查"
|
||||
ROAD_CLOSED.poiType -> "封路"
|
||||
FOURS_ROAD_WORK.poiType -> "施工"
|
||||
AI_ROAD_WORK.poiType -> "施工"
|
||||
FOURS_BLOCK_UP.poiType -> "道路拥堵"
|
||||
FOURS_PONDING.poiType -> "道路积水"
|
||||
FOURS_FOG.poiType -> "出现浓雾"
|
||||
@@ -528,6 +539,7 @@ enum class EventTypeEnum(
|
||||
TRAFFIC_CHECK.poiType -> TRAFFIC_CHECK.content
|
||||
ROAD_CLOSED.poiType -> ROAD_CLOSED.content
|
||||
FOURS_ROAD_WORK.poiType -> FOURS_ROAD_WORK.content
|
||||
AI_ROAD_WORK.poiType -> AI_ROAD_WORK.content
|
||||
FOURS_BLOCK_UP.poiType -> FOURS_BLOCK_UP.content
|
||||
FOURS_PONDING.poiType -> FOURS_PONDING.content
|
||||
FOURS_FOG.poiType -> FOURS_FOG.content
|
||||
@@ -547,6 +559,7 @@ enum class EventTypeEnum(
|
||||
R.drawable.mogo_image_jiaotongjiancha_small
|
||||
ROAD_CLOSED.poiType -> R.drawable.mogo_image_fenglu_small
|
||||
FOURS_ROAD_WORK.poiType -> R.drawable.mogo_image_daolushigong_small
|
||||
AI_ROAD_WORK.poiType -> R.drawable.mogo_image_daolushigong_small
|
||||
FOURS_BLOCK_UP.poiType -> R.drawable.mogo_image_yongdu_small
|
||||
FOURS_PONDING.poiType -> R.drawable.mogo_image_jishui_small
|
||||
FOURS_ICE.poiType -> R.drawable.mogo_image_jiebing_small
|
||||
@@ -564,6 +577,7 @@ enum class EventTypeEnum(
|
||||
TRAFFIC_CHECK.poiType -> R.drawable.mogo_image_jiaotongjiancha_nor
|
||||
ROAD_CLOSED.poiType -> R.drawable.mogo_image_fenglu_nor
|
||||
FOURS_ROAD_WORK.poiType -> R.drawable.mogo_image_daolushigong_nor
|
||||
AI_ROAD_WORK.poiType -> R.drawable.mogo_image_daolushigong_nor
|
||||
FOURS_BLOCK_UP.poiType -> R.drawable.mogo_image_yongdu_nor
|
||||
FOURS_PONDING.poiType -> R.drawable.mogo_image_jishui_nor
|
||||
FOURS_ICE.poiType -> R.drawable.mogo_image_jiebing_nor
|
||||
@@ -586,6 +600,7 @@ enum class EventTypeEnum(
|
||||
FOURS_ACCIDENT_03.poiType, FOURS_ACCIDENT_04.poiType, FOURS_ACCIDENT_05.poiType -> "交通事故"
|
||||
FOURS_BLOCK_UP.poiType -> "拥堵"
|
||||
FOURS_ROAD_WORK.poiType -> "施工"
|
||||
AI_ROAD_WORK.poiType -> "施工"
|
||||
FOURS_PONDING.poiType -> "道路积水"
|
||||
else -> "实时路况"
|
||||
}
|
||||
@@ -600,6 +615,7 @@ enum class EventTypeEnum(
|
||||
FOURS_FOG.poiType -> R.raw.v2x_nongwu
|
||||
TRAFFIC_CHECK.poiType -> R.raw.v2x_jiaotongjiancha
|
||||
FOURS_ROAD_WORK.poiType -> R.raw.v2x_daolushigong
|
||||
AI_ROAD_WORK.poiType -> R.raw.v2x_daolushigong
|
||||
FOURS_ICE.poiType -> R.raw.v2x_daolujiebing
|
||||
FOURS_PONDING.poiType -> R.raw.v2x_daolujishui
|
||||
GHOST_PROBE.poiType -> R.raw.v2x_guzhangqiuzhu
|
||||
@@ -618,6 +634,7 @@ enum class EventTypeEnum(
|
||||
FOURS_ACCIDENT_03.poiType, FOURS_ACCIDENT_04.poiType, FOURS_ACCIDENT_05.poiType -> "交通事故"
|
||||
FOURS_BLOCK_UP.poiType -> "拥堵"
|
||||
FOURS_ROAD_WORK.poiType -> "施工"
|
||||
AI_ROAD_WORK.poiType -> "施工"
|
||||
FOURS_PONDING.poiType -> "道路积水"
|
||||
else -> "实时路况"
|
||||
}
|
||||
@@ -638,6 +655,10 @@ enum class EventTypeEnum(
|
||||
FOURS_ROAD_WORK.poiType -> {
|
||||
R.drawable.v_to_x_marker_11
|
||||
}
|
||||
//AI施工
|
||||
AI_ROAD_WORK.poiType -> {
|
||||
R.drawable.v_to_x_marker_11
|
||||
}
|
||||
//拥堵
|
||||
FOURS_BLOCK_UP.poiType -> {
|
||||
R.drawable.v_to_x_marker_5
|
||||
@@ -760,6 +781,7 @@ enum class EventTypeEnum(
|
||||
TYPE_USECASE_ID_ROAD_GIVE_WAY.poiType -> TYPE_USECASE_ID_ROAD_GIVE_WAY.content
|
||||
TYPE_VIP_IDENTIFICATION.poiType -> TYPE_VIP_IDENTIFICATION.content
|
||||
FOURS_ROAD_WORK.poiType -> FOURS_ROAD_WORK.content
|
||||
AI_ROAD_WORK.poiType -> AI_ROAD_WORK.content
|
||||
TYPE_ERROR.poiType -> TYPE_ERROR.content
|
||||
TYPE_OPTIMAL_ROUTE_RECOMMEND.poiType -> TYPE_OPTIMAL_ROUTE_RECOMMEND.content
|
||||
GHOST_PROBE.poiType -> GHOST_PROBE.content
|
||||
@@ -802,6 +824,7 @@ enum class EventTypeEnum(
|
||||
TYPE_USECASE_ID_ROAD_GIVE_WAY.poiType -> TYPE_USECASE_ID_ROAD_GIVE_WAY.tts
|
||||
TYPE_VIP_IDENTIFICATION.poiType -> TYPE_VIP_IDENTIFICATION.tts
|
||||
FOURS_ROAD_WORK.poiType -> FOURS_ROAD_WORK.tts
|
||||
AI_ROAD_WORK.poiType -> AI_ROAD_WORK.tts
|
||||
TYPE_ERROR.poiType -> TYPE_ERROR.tts
|
||||
TYPE_OPTIMAL_ROUTE_RECOMMEND.poiType -> TYPE_OPTIMAL_ROUTE_RECOMMEND.tts
|
||||
GHOST_PROBE.poiType -> GHOST_PROBE.tts
|
||||
|
||||
@@ -44,6 +44,8 @@ public class CloudPoiManager {
|
||||
R.drawable.module_common_icon_map_marker_road_block_off2, R.drawable.module_common_icon_map_marker_road_block_off2_white, "封路"));
|
||||
poiWrapper.put(EventTypeEnum.FOURS_ROAD_WORK.getPoiType(), new PoiWrapper(EventTypeEnum.FOURS_ROAD_WORK.getPoiType(),
|
||||
R.drawable.module_common_icon_map_marker_road_work2, R.drawable.module_common_icon_map_marker_road_work2_white, "施工"));
|
||||
poiWrapper.put(EventTypeEnum.AI_ROAD_WORK.getPoiType(), new PoiWrapper(EventTypeEnum.AI_ROAD_WORK.getPoiType(),
|
||||
R.drawable.module_common_icon_map_marker_road_work2, R.drawable.module_common_icon_map_marker_road_work2_white, "施工"));
|
||||
poiWrapper.put(EventTypeEnum.FOURS_BLOCK_UP.getPoiType(), new PoiWrapper(EventTypeEnum.FOURS_BLOCK_UP.getPoiType(),
|
||||
R.drawable.module_common_icon_map_marker_road_block_up2, R.drawable.module_common_icon_map_marker_road_block_up2_white, "拥堵"));
|
||||
poiWrapper.put(EventTypeEnum.FOURS_PONDING.getPoiType(), new PoiWrapper(EventTypeEnum.FOURS_PONDING.getPoiType(),
|
||||
|
||||
@@ -66,7 +66,7 @@ public class MogoServiceProvider implements IMogoModuleProvider {
|
||||
MarkerServiceHandler.init( context );
|
||||
MogoServices.getInstance().preInit( context );
|
||||
MogoServices.getInstance().init( AbsMogoApplication.getApp() );
|
||||
MogoRouteOverlayManager.getInstance(context).init();
|
||||
MogoRouteOverlayManager.getInstance().init();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,29 +1,25 @@
|
||||
package com.mogo.module.service.routeoverlay;
|
||||
|
||||
import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_OLD_ROUTE;
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.SystemClock;
|
||||
import android.util.Log;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotStatusInfo;
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig;
|
||||
import com.mogo.eagle.core.data.deva.scene.SceneModule;
|
||||
import com.mogo.eagle.core.data.map.MogoLocation;
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotPlanningListener;
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener;
|
||||
import com.mogo.eagle.core.function.api.map.listener.IMoGoMapLocationListener;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotPlanningListenerManager;
|
||||
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager;
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapLocationListenerManager;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
import java.util.concurrent.locks.Lock;
|
||||
import java.util.concurrent.locks.ReentrantLock;
|
||||
|
||||
import mogo.telematics.pad.MessagePad;
|
||||
import mogo_msg.MogoReportMsg;
|
||||
|
||||
@@ -31,107 +27,57 @@ public class MogoRouteOverlayManager implements
|
||||
IMoGoAutopilotPlanningListener, IMoGoAutopilotStatusListener,
|
||||
IMoGoMapLocationListener {
|
||||
private static volatile MogoRouteOverlayManager sInstance;
|
||||
private Context mContext;
|
||||
private String TAG = "route";
|
||||
private static final String TAG = "Route";
|
||||
private int STATUS_AUTOPILOT = 0;//0 非自动驾驶 ; 1 自动驾驶
|
||||
// private MogoLatLng mEnding;
|
||||
private MogoLocation mLocation;
|
||||
private AtomicBoolean isArriveAtStation = new AtomicBoolean(false);
|
||||
private final AtomicBoolean isArriveAtStation = new AtomicBoolean(false);
|
||||
|
||||
private volatile List<MessagePad.TrajectoryPoint> mTrajectoryList = null;
|
||||
private List<MessagePad.TrajectoryPoint> mTrajectoryList = null;
|
||||
|
||||
private MogoRouteOverlayManager(Context context) {
|
||||
mContext = context;
|
||||
}
|
||||
private final Lock mLock = new ReentrantLock();
|
||||
|
||||
private MogoRouteOverlayManager() {}
|
||||
|
||||
|
||||
public void init() {
|
||||
CallerAutopilotPlanningListenerManager.INSTANCE.addListener(TAG, this);
|
||||
CallerAutoPilotStatusListenerManager.INSTANCE.addListener(TAG, this);
|
||||
CallerMapLocationListenerManager.INSTANCE.addListener(TAG, this);
|
||||
// intiDrawer();
|
||||
}
|
||||
|
||||
public static MogoRouteOverlayManager getInstance(Context context) {
|
||||
public static MogoRouteOverlayManager getInstance() {
|
||||
if (sInstance == null) {
|
||||
synchronized (MogoRouteOverlayManager.class) {
|
||||
if (sInstance == null) {
|
||||
sInstance = new MogoRouteOverlayManager(context);
|
||||
sInstance = new MogoRouteOverlayManager();
|
||||
}
|
||||
}
|
||||
}
|
||||
return sInstance;
|
||||
}
|
||||
|
||||
private StringBuilder trajectoryMsg = null;
|
||||
|
||||
@Override
|
||||
public void onAutopilotTrajectory(@NonNull List<MessagePad.TrajectoryPoint> items) {
|
||||
long start = SystemClock.elapsedRealtime();
|
||||
if (isArriveAtStation.get()) {
|
||||
return;
|
||||
}
|
||||
if (items.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
MogoLocation location = mLocation;
|
||||
if (location == null) {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
if (isArriveAtStation.get()) {
|
||||
return;
|
||||
}
|
||||
if (items.size() == 0) {
|
||||
return;
|
||||
}
|
||||
MogoLocation location = mLocation;
|
||||
if (location == null) {
|
||||
return;
|
||||
}
|
||||
mLock.lock();
|
||||
mTrajectoryList = items;
|
||||
Map<String, SceneModule> tags = CallerDevaToolsManager.INSTANCE.getModuleTAG();
|
||||
boolean isPrintLog = false;
|
||||
if (tags != null && tags.containsKey(SceneConstant.M_OLD_ROUTE)) {
|
||||
SceneModule scene = tags.get(M_OLD_ROUTE);
|
||||
isPrintLog = scene.getLog();
|
||||
}
|
||||
if (isPrintLog) {
|
||||
if (trajectoryMsg == null) {
|
||||
trajectoryMsg = new StringBuilder(128);
|
||||
}
|
||||
if (trajectoryMsg.length() > 0) {
|
||||
trajectoryMsg.setLength(0);
|
||||
}
|
||||
trajectoryMsg.append("{");
|
||||
trajectoryMsg.append(System.currentTimeMillis()).append(";");
|
||||
trajectoryMsg.append(location.getLongitude()).append(";");
|
||||
trajectoryMsg.append(location.getLatitude()).append(";");
|
||||
trajectoryMsg.append(location.getAltitude()).append(";");
|
||||
trajectoryMsg.append(location.getBearing()).append(";");
|
||||
trajectoryMsg.append(location.getSpeed()).append(";");
|
||||
for (int i = 0; i < items.size(); i++) {
|
||||
// 临时解决车尾拖线问题,丢弃距离车最近的几个经纬度,原因是惯性导航的中心靠近车尾,会导致经纬度靠近尾部,且两个数据不同频
|
||||
MessagePad.TrajectoryPoint a = items.get(i);
|
||||
double lon = a.getLongitude();
|
||||
double lat = a.getLatitude();
|
||||
trajectoryMsg.append(lon).append(",");
|
||||
trajectoryMsg.append(lat).append(",");
|
||||
}
|
||||
trajectoryMsg.append("}");
|
||||
CallerLogger.INSTANCE.d(M_OLD_ROUTE + TAG, "receive router data:" + items.size());
|
||||
CallerLogger.INSTANCE.d(M_OLD_ROUTE + TAG, trajectoryMsg.toString());
|
||||
} else {
|
||||
CallerLogger.INSTANCE.d(M_OLD_ROUTE + TAG, "receive router data:" + items.size());
|
||||
}
|
||||
} finally {
|
||||
CallerLogger.INSTANCE.d(M_OLD_ROUTE + TAG, "--- onAutopilotTrajectory -- cost:" + (SystemClock.elapsedRealtime() - start) + " ms");
|
||||
mLock.unlock();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAutopilotRotting(MessagePad.GlobalPathResp globalPathResp) {
|
||||
// if (globalPathResp == null || globalPathResp.getWayPointsList().size() == 0) {
|
||||
// return;
|
||||
// }
|
||||
// List<MogoLatLng> latLngList = new ArrayList<>();
|
||||
// for (MessagePad.Location routeModel : globalPathResp.getWayPointsList()) {
|
||||
// latLngList.add(new MogoLatLng(routeModel.getLatitude(), routeModel.getLongitude()));
|
||||
// }
|
||||
// int listSize = latLngList.size();
|
||||
// mEnding = latLngList.get(listSize - 1);
|
||||
// RouteOverlayDrawer.getInstance(mContext).addEndingMarker(latLngList.get(listSize - 1).lat,latLngList.get(listSize - 1).lon);
|
||||
}
|
||||
public void onAutopilotRotting(MessagePad.GlobalPathResp globalPathResp) {}
|
||||
|
||||
|
||||
@Override
|
||||
@@ -144,34 +90,20 @@ public class MogoRouteOverlayManager implements
|
||||
if (this.STATUS_AUTOPILOT == 1) {
|
||||
isArriveAtStation.set(false);
|
||||
}
|
||||
//CallerLogger.INSTANCE.d(M_OLD_ROUTE + TAG ,"onAutopilotStatusResponse:"+STATUS_AUTOPILOT);
|
||||
// if (STATUS_AUTOPILOT == 1 ){
|
||||
// if (mEnding != null){
|
||||
// RouteOverlayDrawer.getInstance(mContext).addEndingMarker(mEnding.lat,mEnding.lon);
|
||||
// }
|
||||
// }else {
|
||||
//
|
||||
// }
|
||||
if (STATUS_AUTOPILOT != 1) {
|
||||
RouteOverlayDrawer.getInstance(mContext).clearEndingMarker();
|
||||
RouteOverlayDrawer.getInstance(mContext).clearMogoRouteOverlay();
|
||||
RouteOverlayDrawer.getInstance().clearMogoRouteOverlay();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAutopilotArriveAtStation(MessagePad.ArrivalNotification arrivalNotification) {
|
||||
|
||||
if (arrivalNotification == null) {
|
||||
return;
|
||||
}
|
||||
CallerLogger.INSTANCE.d(M_OLD_ROUTE + TAG, "onArriveAt data : " + arrivalNotification);
|
||||
// //演示模式下 到达终点将忽略 引导线绘制 选项关闭
|
||||
// FunctionBuildConfig.isIgnoreConditionsDrawAutopilotTrajectoryData = false;
|
||||
|
||||
Log.d(TAG, "onArriveAt data : " + arrivalNotification);
|
||||
if (!isArriveAtStation.get()) {
|
||||
isArriveAtStation.set(true);
|
||||
RouteOverlayDrawer.getInstance(mContext).clearEndingMarker();
|
||||
RouteOverlayDrawer.getInstance(mContext).clearMogoRouteOverlay();
|
||||
RouteOverlayDrawer.getInstance().clearMogoRouteOverlay();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -186,7 +118,6 @@ public class MogoRouteOverlayManager implements
|
||||
if (from != 1) {
|
||||
return;
|
||||
}
|
||||
long start = SystemClock.elapsedRealtime();
|
||||
boolean isExcept = false;
|
||||
try {
|
||||
if (location == null) {
|
||||
@@ -194,14 +125,13 @@ public class MogoRouteOverlayManager implements
|
||||
return;
|
||||
}
|
||||
if (FunctionBuildConfig.isIgnoreConditionsDrawAutopilotTrajectoryData || STATUS_AUTOPILOT == 1) {
|
||||
RouteOverlayDrawer.getInstance(mContext).drawTrajectoryList(location, mTrajectoryList);
|
||||
RouteOverlayDrawer.getInstance().drawTrajectoryList(mLock, location, mTrajectoryList);
|
||||
}
|
||||
} finally {
|
||||
mLocation = location;
|
||||
if (isExcept) {
|
||||
RouteOverlayDrawer.getInstance(mContext).setVisible(false);
|
||||
RouteOverlayDrawer.getInstance().hide();
|
||||
}
|
||||
// CallerLogger.INSTANCE.d(M_OLD_ROUTE + TAG, "--- onLocationChanged -- cost:" + (SystemClock.elapsedRealtime() - start) + " ms");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,70 +1,42 @@
|
||||
package com.mogo.module.service.routeoverlay;
|
||||
|
||||
import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_OLD_ROUTE;
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.Context;
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.BitmapFactory;
|
||||
import android.graphics.Color;
|
||||
import android.os.Handler;
|
||||
import android.os.HandlerThread;
|
||||
import android.os.SystemClock;
|
||||
import android.util.Log;
|
||||
import androidx.core.util.Pools;
|
||||
import com.mogo.eagle.core.data.map.MogoLatLng;
|
||||
import com.mogo.eagle.core.data.map.MogoLocation;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.eagle.core.utilcode.util.ColorUtils;
|
||||
import com.mogo.map.MogoMarkerManager;
|
||||
import com.mogo.map.MogoOverlayManager;
|
||||
import com.mogo.map.marker.IMogoMarker;
|
||||
import com.mogo.map.marker.MogoMarkerOptions;
|
||||
import com.mogo.map.overlay.IMogoOverlayManager;
|
||||
import com.mogo.map.overlay.IMogoPolyline;
|
||||
import com.mogo.map.overlay.MogoPolylineOptions;
|
||||
import com.mogo.module.common.utils.DrivingDirectionUtils;
|
||||
import com.mogo.module.service.R;
|
||||
import java.util.ArrayList;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.locks.Lock;
|
||||
import mogo.telematics.pad.MessagePad;
|
||||
|
||||
public class RouteOverlayDrawer {
|
||||
|
||||
private static final String TAG = "MogoRouteOverlayManager";
|
||||
|
||||
private volatile IMogoPolyline mMoGoPolyline;
|
||||
// 连接线参数
|
||||
private final MogoPolylineOptions mPolylineOptions;
|
||||
|
||||
private Handler mRenderHandler;
|
||||
|
||||
private final Bitmap endingBitmap;
|
||||
private final Context mContext;
|
||||
// private Handler mLogHandler;
|
||||
|
||||
IMogoOverlayManager mogoOverlayManager;
|
||||
private IMogoMarker endMarker;
|
||||
private MogoMarkerOptions markerOptions;
|
||||
private static volatile RouteOverlayDrawer sInstance;
|
||||
private static final String markerType = "route_ending";
|
||||
|
||||
private RouteOverlayDrawer(Context context) {
|
||||
mPolylineOptions = new MogoPolylineOptions();
|
||||
mPolylineOptions.zIndex(75000f);
|
||||
mPolylineOptions.setGps(true);
|
||||
// 引导线颜色,
|
||||
private RouteOverlayDrawer() {
|
||||
// 渐变色
|
||||
mContext = context;
|
||||
mogoOverlayManager = MogoOverlayManager.getInstance();
|
||||
endingBitmap = BitmapFactory.decodeResource(context.getResources(),
|
||||
R.drawable.icon_route_ending);
|
||||
|
||||
List<Integer> list = new ArrayList<>();
|
||||
int[] startColor = ColorUtils.hexToArgb("#CC64C3EA");
|
||||
int[] endColor = ColorUtils.hexToArgb("#0064C3EA");
|
||||
list.add(Color.argb(startColor[0], startColor[1], startColor[2], startColor[3]));
|
||||
list.add(Color.argb(endColor[0], endColor[1], endColor[2], endColor[3]));
|
||||
// 线条粗细,渐变,渐变色值
|
||||
mPolylineOptions.width(20).useGradient(true).colorValues(list);
|
||||
HandlerThread renderTask = new HandlerThread("routing_render") {
|
||||
@Override
|
||||
protected void onLooperPrepared() {
|
||||
@@ -73,153 +45,307 @@ public class RouteOverlayDrawer {
|
||||
}
|
||||
};
|
||||
renderTask.start();
|
||||
|
||||
// HandlerThread logHandler = new HandlerThread("log_handler") {
|
||||
// @Override
|
||||
// protected void onLooperPrepared() {
|
||||
// super.onLooperPrepared();
|
||||
// mLogHandler = new Handler(getLooper());
|
||||
// }
|
||||
// };
|
||||
// logHandler.start();
|
||||
}
|
||||
|
||||
public static RouteOverlayDrawer getInstance(Context context) {
|
||||
public static RouteOverlayDrawer getInstance() {
|
||||
if (sInstance == null) {
|
||||
synchronized (RouteOverlayDrawer.class) {
|
||||
if (sInstance == null) {
|
||||
sInstance = new RouteOverlayDrawer(context);
|
||||
sInstance = new RouteOverlayDrawer();
|
||||
}
|
||||
}
|
||||
}
|
||||
return sInstance;
|
||||
}
|
||||
|
||||
public synchronized void release() {
|
||||
sInstance = null;
|
||||
}
|
||||
|
||||
private Object readResolve() {
|
||||
// 阻止反序列化,必须实现 Serializable 接口
|
||||
return sInstance;
|
||||
}
|
||||
|
||||
public void addEndingMarker(double lat, double lon) {
|
||||
if (endMarker != null) {
|
||||
return;
|
||||
}
|
||||
if (markerOptions == null) {
|
||||
markerOptions = new MogoMarkerOptions()
|
||||
.matchOnRoadSide(true)
|
||||
.gps(true)
|
||||
.icon(endingBitmap)
|
||||
.owner(markerType)
|
||||
.anchor(0.5f, 0.5f)
|
||||
.scale(0.5f)
|
||||
.zIndex(30001);
|
||||
// .object(markerShowEntity)
|
||||
}
|
||||
markerOptions.latitude(lat).longitude(lon);
|
||||
//CallerLogger.INSTANCE.d(M_OLD_ROUTE + TAG,"addEndingMarker-"+lat+":"+lon);
|
||||
endMarker = MogoMarkerManager.getInstance(mContext).addMarker(markerType, markerOptions);
|
||||
// if (DebugConfig.isDebug()){
|
||||
// ToastUtils.showLong("绘制终点marker,"+lat+":"+lon);
|
||||
// }
|
||||
}
|
||||
|
||||
public void clearMogoRouteOverlay() {
|
||||
if (mMoGoPolyline != null) {
|
||||
mMoGoPolyline.remove();
|
||||
mMoGoPolyline = null;
|
||||
}
|
||||
|
||||
if (mRenderTask != null) {
|
||||
if (mRenderTask != null && mRenderHandler != null) {
|
||||
mRenderTask.remove();
|
||||
mRenderHandler.removeCallbacks(mRenderTask);
|
||||
}
|
||||
}
|
||||
|
||||
public void clearEndingMarker() {
|
||||
//CallerLogger.INSTANCE.d(M_OLD_ROUTE + TAG,"clearEndingMarker");
|
||||
endMarker = null;
|
||||
MogoMarkerManager.getInstance(mContext).removeMarkers(markerType);
|
||||
public void remove() {
|
||||
if (mRenderTask != null && mRenderHandler != null) {
|
||||
mRenderTask.remove();
|
||||
mRenderHandler.removeCallbacks(mRenderTask);
|
||||
}
|
||||
}
|
||||
|
||||
public void hide() {
|
||||
if (mRenderTask != null && mRenderHandler != null) {
|
||||
mRenderTask.hide();
|
||||
mRenderHandler.removeCallbacks(mRenderTask);
|
||||
}
|
||||
}
|
||||
|
||||
private static class RenderOptions {
|
||||
|
||||
private IMogoPolyline mPolyLine;
|
||||
private final MogoPolylineOptions mOptions;
|
||||
|
||||
private static int taskSequence = 0;
|
||||
|
||||
//private Handler mHandler;
|
||||
|
||||
private final IMogoOverlayManager mOverlayManager;
|
||||
|
||||
//private ChildRenderTask mTask;
|
||||
|
||||
private class ChildRenderTask implements Runnable {
|
||||
|
||||
private List<Integer> colors;
|
||||
private List<MogoLatLng> points;
|
||||
|
||||
public void setData(List<Integer> colors, List<MogoLatLng> points) {
|
||||
this.colors = colors;
|
||||
this.points = points;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
if (this.colors == null || this.colors.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.points == null || this.points.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
mOptions.colorValues(colors);
|
||||
mOptions.points(points);
|
||||
if (mPolyLine == null || mPolyLine.isDestroyed()) {
|
||||
mPolyLine = mOverlayManager.addPolyline(mOptions);
|
||||
} else {
|
||||
mPolyLine.setOption(mOptions);
|
||||
}
|
||||
if (mPolyLine != null && !mPolyLine.isVisible()) {
|
||||
mPolyLine.setVisible(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public RenderOptions(IMogoOverlayManager overlay) {
|
||||
mOverlayManager = overlay;
|
||||
mOptions = new MogoPolylineOptions().width(20).useGradient(true).zIndex(75000f).setGps(true);
|
||||
// new HandlerThread("child-render-" +(taskSequence++)) {
|
||||
// @Override
|
||||
// protected void onLooperPrepared() {
|
||||
// super.onLooperPrepared();
|
||||
// mHandler = new Handler(getLooper());
|
||||
// }
|
||||
// }.start();
|
||||
}
|
||||
|
||||
public void show(List<Integer> colors, List<MogoLatLng> points) {
|
||||
// if (mTask == null) {
|
||||
// mTask = new ChildRenderTask();
|
||||
// }
|
||||
// mTask.setData(colors, points);
|
||||
// if (mHandler != null) {
|
||||
// mHandler.removeCallbacks(mTask);
|
||||
// mHandler.post(mTask);
|
||||
// }
|
||||
mOptions.colorValues(colors);
|
||||
mOptions.points(points);
|
||||
if (mPolyLine == null || mPolyLine.isDestroyed()) {
|
||||
mPolyLine = mOverlayManager.addPolyline(mOptions);
|
||||
} else {
|
||||
mPolyLine.setOption(mOptions);
|
||||
}
|
||||
if (mPolyLine != null && !mPolyLine.isVisible()) {
|
||||
mPolyLine.setVisible(true);
|
||||
}
|
||||
}
|
||||
|
||||
public void hide() {
|
||||
// if (mTask != null && mHandler != null) {
|
||||
// mHandler.removeCallbacks(mTask);
|
||||
// }
|
||||
if (mPolyLine != null && mPolyLine.isVisible()) {
|
||||
mPolyLine.setVisible(false);
|
||||
}
|
||||
}
|
||||
|
||||
public void remove() {
|
||||
// if (mTask != null && mHandler != null) {
|
||||
// mHandler.removeCallbacks(mTask);
|
||||
// }
|
||||
if (mPolyLine != null && !mPolyLine.isDestroyed()) {
|
||||
mPolyLine.remove();
|
||||
mPolyLine = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private class RenderTask implements Runnable {
|
||||
private volatile List<MessagePad.TrajectoryPoint> routeList;
|
||||
private volatile MogoLocation location;
|
||||
private List<MessagePad.TrajectoryPoint> routeList;
|
||||
private MogoLocation location;
|
||||
|
||||
private final Pools.Pool<MogoLatLng> pools;
|
||||
private final LinkedList<MogoLatLng> points;
|
||||
|
||||
private final Pools.Pool<RenderOptions> options;
|
||||
private Lock mLock;
|
||||
|
||||
public RenderTask() {
|
||||
this.pools = new Pools.SimplePool<>(500);
|
||||
this.points = new LinkedList<>();
|
||||
this.options = new Pools.SimplePool<>(5);
|
||||
}
|
||||
|
||||
public void setData(MogoLocation location, List<MessagePad.TrajectoryPoint> routeList) {
|
||||
public void setData(Lock lock, MogoLocation location, List<MessagePad.TrajectoryPoint> routeList) {
|
||||
this.location = location;
|
||||
this.routeList = routeList;
|
||||
this.mLock = lock;
|
||||
}
|
||||
|
||||
@SuppressLint("LongLogTag")
|
||||
@Override
|
||||
public void run() {
|
||||
LinkedList<MogoLatLng> points = this.points;
|
||||
points.clear();
|
||||
Lock lock = this.mLock;
|
||||
if (lock == null) {
|
||||
return;
|
||||
}
|
||||
LinkedList<MogoLatLng> pps = this.points;
|
||||
boolean isExcept = false;
|
||||
// StringBuilder sb;
|
||||
int total;
|
||||
try {
|
||||
pps.clear();
|
||||
long drawStart = SystemClock.elapsedRealtime();
|
||||
List<MessagePad.TrajectoryPoint> routes = this.routeList;
|
||||
int total;
|
||||
if (routes == null || (total = routes.size()) < 2) {
|
||||
isExcept = true;
|
||||
return;
|
||||
}
|
||||
for (int i = 0; i < total; i++) {
|
||||
MessagePad.TrajectoryPoint route = null;
|
||||
try {
|
||||
route = routes.get(i);
|
||||
if (route == null) {
|
||||
continue;
|
||||
try {
|
||||
lock.lock();
|
||||
List<MessagePad.TrajectoryPoint> routes = this.routeList;
|
||||
if (routes == null || (total = routes.size()) < 2) {
|
||||
isExcept = true;
|
||||
return;
|
||||
}
|
||||
RouteStrategy.INSTANCE.start();
|
||||
// sb = new StringBuilder();
|
||||
// sb.append(System.currentTimeMillis()).append(" ");
|
||||
for (int i = 0; i < total; i++) {
|
||||
MessagePad.TrajectoryPoint route = null;
|
||||
try {
|
||||
route = routes.get(i);
|
||||
if (route == null) {
|
||||
continue;
|
||||
}
|
||||
} catch (Throwable t) {
|
||||
Log.d("Route", "render-error:" + t.getMessage());
|
||||
}
|
||||
} catch (Throwable t) {
|
||||
CallerLogger.INSTANCE.d(M_OLD_ROUTE + TAG, "render-error:" + t.getMessage());
|
||||
if (route == null) {
|
||||
//数组越界了,结束循环
|
||||
break;
|
||||
}
|
||||
|
||||
// sb.append(route.getVelocity()).append(" ");
|
||||
// sb.append(route.getAcceleration()).append(" ");
|
||||
// sb.append(route.getAccumulatedDis()).append(" ");
|
||||
MogoLatLng acquire = pools.acquire();
|
||||
double latitude = route.getLatitude();
|
||||
double longitude = route.getLongitude();
|
||||
if (acquire == null) {
|
||||
acquire = new MogoLatLng(latitude, longitude);
|
||||
} else {
|
||||
acquire.lon = longitude;
|
||||
acquire.lat = latitude;
|
||||
}
|
||||
pps.add(acquire);
|
||||
RouteStrategy.INSTANCE.check(route.getVelocity(), route.getAcceleration());
|
||||
}
|
||||
if (route == null) {
|
||||
//数组越界了,结束循环
|
||||
break;
|
||||
RouteStrategy.INSTANCE.end();
|
||||
} finally {
|
||||
lock.unlock();
|
||||
}
|
||||
Strategy strategy = RouteStrategy.INSTANCE.getStrategy();
|
||||
/// Log.d("ROUTE_XX", "strategy:" + strategy + "->route: " +sb);
|
||||
|
||||
// StringBuilder newSb = new StringBuilder("strategy:" + strategy + "->route: ");
|
||||
// newSb.append(sb);
|
||||
// if (mLogHandler != null) {
|
||||
// mLogHandler.sendMessage(Message.obtain(mLogHandler, () -> {
|
||||
// BufferedWriter bw = null;
|
||||
// try {
|
||||
// File file = new File(Environment.getExternalStorageDirectory(), "log.txt");
|
||||
// if (!file.exists()) {
|
||||
// file.createNewFile();
|
||||
// }
|
||||
// bw = new BufferedWriter(new FileWriter(file, true));
|
||||
// bw.write(newSb.toString());
|
||||
// bw.newLine();
|
||||
// bw.flush();
|
||||
// } catch (Throwable t) {
|
||||
// try {
|
||||
// if (bw != null) {
|
||||
// bw.close();
|
||||
// }
|
||||
// } catch (Throwable t2) {
|
||||
//
|
||||
// }
|
||||
// }
|
||||
// }));
|
||||
// }
|
||||
Integer[] indexes = strategy.getIndexes();
|
||||
Integer[] colors = strategy.getColors();
|
||||
LinkedList<LinkedList<MogoLatLng>> parts = new LinkedList<>();
|
||||
if (indexes.length > 0) {
|
||||
for (int i = 0; i < indexes.length; i += 2) {
|
||||
int startIndex = indexes[i];
|
||||
int endIndex = indexes[i + 1];
|
||||
parts.add(new LinkedList<>(pps.subList(startIndex, Math.min(endIndex + 1, pps.size()))));
|
||||
}
|
||||
MogoLatLng acquire = pools.acquire();
|
||||
double latitude = route.getLatitude();
|
||||
double longitude = route.getLongitude();
|
||||
if (acquire == null) {
|
||||
acquire = new MogoLatLng(latitude, longitude);
|
||||
} else {
|
||||
acquire.lon = longitude;
|
||||
acquire.lat = latitude;
|
||||
}
|
||||
points.add(acquire);
|
||||
}
|
||||
double lon = CallerAutoPilotStatusListenerManager.INSTANCE.getCurWgs84Lon();
|
||||
double lat = CallerAutoPilotStatusListenerManager.INSTANCE.getCurWgs84Lat();
|
||||
int removeCount = 0;
|
||||
if (points.size() > 0) {
|
||||
MogoLatLng top = null;
|
||||
while (points.size() != 0) {
|
||||
MogoLatLng first = points.peek();
|
||||
if (first == null) {
|
||||
int colorsIndex = 0;
|
||||
if (!parts.isEmpty()) {
|
||||
L:while (!parts.isEmpty()) {
|
||||
LinkedList<MogoLatLng> part = parts.peek();
|
||||
if (part == null) {
|
||||
continue;
|
||||
}
|
||||
if (first == top) {
|
||||
break;
|
||||
MogoLatLng top = null;
|
||||
while (!part.isEmpty()) {
|
||||
MogoLatLng first = part.peek();
|
||||
if (first == null) {
|
||||
part.poll();
|
||||
continue;
|
||||
}
|
||||
if (first == top) {
|
||||
break L;
|
||||
}
|
||||
lon = CallerAutoPilotStatusListenerManager.INSTANCE.getCurWgs84Lon();
|
||||
lat = CallerAutoPilotStatusListenerManager.INSTANCE.getCurWgs84Lat();
|
||||
long angle = isPointOnCarFront(lon, lat, location.getBearing(), first.lon, first.lat);
|
||||
if (angle >= 90) {
|
||||
removeCount++;
|
||||
pps.remove(first);
|
||||
try {
|
||||
pools.release(first);
|
||||
} catch (Throwable ignore) {
|
||||
} finally {
|
||||
part.poll();
|
||||
}
|
||||
}
|
||||
top = first;
|
||||
}
|
||||
lon = CallerAutoPilotStatusListenerManager.INSTANCE.getCurWgs84Lon();
|
||||
lat = CallerAutoPilotStatusListenerManager.INSTANCE.getCurWgs84Lat();
|
||||
long angle = isPointOnCarFront(lon, lat, location.getBearing(), first.lon, first.lat);
|
||||
if (angle >= 90) {
|
||||
removeCount++;
|
||||
pools.release(first);
|
||||
points.poll();
|
||||
}
|
||||
top = first;
|
||||
parts.poll();
|
||||
colorsIndex += 2;
|
||||
}
|
||||
|
||||
if (points.size() == 0) {
|
||||
if (parts.isEmpty()) {
|
||||
isExcept = true;
|
||||
return;
|
||||
}
|
||||
|
||||
MogoLatLng self = pools.acquire();
|
||||
if (self == null) {
|
||||
self = new MogoLatLng(lat, lon);
|
||||
@@ -227,70 +353,102 @@ public class RouteOverlayDrawer {
|
||||
self.lat = lat;
|
||||
self.lon = lon;
|
||||
}
|
||||
points.addFirst(self);
|
||||
if (mMoGoPolyline == null || mMoGoPolyline.isDestroyed()) {
|
||||
mPolylineOptions.points(points);
|
||||
mMoGoPolyline = mogoOverlayManager.addPolyline(mPolylineOptions);
|
||||
} else {
|
||||
mPolylineOptions.points(points);
|
||||
mMoGoPolyline.setOption(mPolylineOptions);
|
||||
pps.addFirst(self);
|
||||
parts.get(0).addFirst(self);
|
||||
List<RenderOptions> ll = new ArrayList<>();
|
||||
for (int i = 0; i < parts.size(); i++) {
|
||||
LinkedList<MogoLatLng> ps = parts.get(i);
|
||||
RenderOptions options = this.options.acquire();
|
||||
if (options == null) {
|
||||
options = new RenderOptions(mogoOverlayManager);
|
||||
}
|
||||
ll.add(options);
|
||||
List<Integer> cls = new ArrayList<>();
|
||||
cls.add(colors[colorsIndex++]);
|
||||
cls.add(colors[colorsIndex++]);
|
||||
options.show(cls, ps);
|
||||
}
|
||||
if (mMoGoPolyline != null && !mMoGoPolyline.isDestroyed() && !mMoGoPolyline.isVisible()) {
|
||||
mMoGoPolyline.setVisible(true);
|
||||
hide();
|
||||
for (int i = ll.size() - 1; i >= 0 ; i--) {
|
||||
this.options.release(ll.get(i));
|
||||
}
|
||||
} else {
|
||||
isExcept = true;
|
||||
}
|
||||
long drawEnd = SystemClock.elapsedRealtime();
|
||||
CallerLogger.INSTANCE.d(M_OLD_ROUTE + TAG, "drawTrajectoryList cost : " + (drawEnd - drawStart) + "ms and isExcept:" + isExcept + "::removeCount:" + removeCount + "::total:" + total);
|
||||
Log.d("Route", "draw cost:" + (drawEnd - drawStart) + "ms and isExcept:" + isExcept + "::removeCount:" + removeCount + "::total:" + total);
|
||||
} catch (Throwable t) {
|
||||
CallerLogger.INSTANCE.d(M_OLD_ROUTE + TAG, "drawTrajectoryList error (isExcept: "+isExcept+") : " + t);
|
||||
Log.d("Route","error:" + Log.getStackTraceString(t));
|
||||
} finally {
|
||||
if (isExcept) {
|
||||
setVisible(false);
|
||||
}
|
||||
if (points.size() > 0) {
|
||||
for (int i = 0; i < points.size(); i++) {
|
||||
MogoLatLng latLng = points.get(i);
|
||||
if (latLng == null) {
|
||||
continue;
|
||||
}
|
||||
pools.release(latLng);
|
||||
try {
|
||||
if (isExcept) {
|
||||
hide();
|
||||
}
|
||||
if (!pps.isEmpty()) {
|
||||
for (int i = 0; i < pps.size(); i++) {
|
||||
MogoLatLng latLng = pps.get(i);
|
||||
if (latLng == null) {
|
||||
continue;
|
||||
}
|
||||
pools.release(latLng);
|
||||
}
|
||||
}
|
||||
} catch (Throwable t) {
|
||||
Log.d("Route", "error2:" + Log.getStackTraceString(t));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void hide() {
|
||||
List<RenderOptions> list = new ArrayList<>();
|
||||
RenderOptions acquire = this.options.acquire();
|
||||
while (acquire != null) {
|
||||
acquire.hide();
|
||||
list.add(acquire);
|
||||
acquire = this.options.acquire();
|
||||
}
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
this.options.release(list.get(i));
|
||||
}
|
||||
}
|
||||
|
||||
public void remove() {
|
||||
List<RenderOptions> list = new ArrayList<>();
|
||||
RenderOptions acquire = this.options.acquire();
|
||||
while (acquire != null) {
|
||||
acquire.remove();
|
||||
list.add(acquire);
|
||||
acquire = this.options.acquire();
|
||||
}
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
this.options.release(list.get(i));
|
||||
}
|
||||
}
|
||||
|
||||
private long isPointOnCarFront(double car_lon, double car_lat, double car_head, double lon, double lat) {
|
||||
long start = SystemClock.elapsedRealtime();
|
||||
try {
|
||||
// 计算车辆与点之间的夹角
|
||||
long diffAngle = DrivingDirectionUtils.getDegreeOfCar2Poi2(
|
||||
car_lon, car_lat, lon, lat, car_head);
|
||||
CallerLogger.INSTANCE.d(M_OLD_ROUTE + TAG, "isPointOnCarFront: angle->" + diffAngle);
|
||||
Log.d("Route", "isPointOnCarFront: angle->" + diffAngle);
|
||||
return diffAngle;
|
||||
} finally {
|
||||
CallerLogger.INSTANCE.d(M_OLD_ROUTE + TAG, "isPointOnCarFront cost:" + (SystemClock.elapsedRealtime() - start) + "ms");
|
||||
Log.d("Route", "isPointOnCarFront cost:" + (SystemClock.elapsedRealtime() - start) + "ms");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private volatile RenderTask mRenderTask;
|
||||
private RenderTask mRenderTask;
|
||||
|
||||
public void drawTrajectoryList(MogoLocation carLoc, List<MessagePad.TrajectoryPoint> routeList) {
|
||||
public void drawTrajectoryList(Lock lock, MogoLocation carLoc, List<MessagePad.TrajectoryPoint> routeList) {
|
||||
if (mRenderTask == null) {
|
||||
mRenderTask = new RenderTask();
|
||||
}
|
||||
mRenderTask.setData(carLoc, routeList);
|
||||
mRenderTask.setData(lock, carLoc, routeList);
|
||||
if (mRenderHandler != null) {
|
||||
mRenderHandler.removeCallbacks(mRenderTask);
|
||||
mRenderHandler.post(mRenderTask);
|
||||
}
|
||||
}
|
||||
|
||||
public void setVisible(boolean isVisible) {
|
||||
if (mMoGoPolyline != null && !mMoGoPolyline.isDestroyed()) {
|
||||
mMoGoPolyline.setVisible(isVisible);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,202 @@
|
||||
package com.mogo.module.service.routeoverlay
|
||||
|
||||
import android.graphics.*
|
||||
import com.mogo.eagle.core.data.config.*
|
||||
import com.mogo.eagle.core.utilcode.mogo.*
|
||||
import java.lang.Double.NaN
|
||||
import java.util.*
|
||||
import kotlin.collections.ArrayList
|
||||
|
||||
|
||||
interface IStrategy {
|
||||
|
||||
fun getColors(): Array<Int>
|
||||
|
||||
fun getIndexes(): Array<Int>
|
||||
}
|
||||
|
||||
class Colors {
|
||||
|
||||
companion object {
|
||||
val COLOR_BLUE_DARK = Color.parseColor("#2ABAD9")
|
||||
val COLOR_BLUE_LIGHT = Color.parseColor("#332ABAD9")
|
||||
val COLOR_RED_DARK = Color.parseColor("#CA4C15")
|
||||
val COLOR_TRANSPARENT = Color.parseColor("#002ABAD9")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
sealed class Strategy: IStrategy
|
||||
|
||||
class Uniform(private val count: Int, private val colors: Array<Int>? = null): Strategy() {
|
||||
|
||||
override fun getColors(): Array<Int> = colors ?: arrayOf(Colors.COLOR_BLUE_DARK, Colors.COLOR_TRANSPARENT)
|
||||
|
||||
override fun getIndexes(): Array<Int> = arrayOf(0, count)
|
||||
}
|
||||
|
||||
|
||||
class SlowDown(private val colors: Array<Int>, private val indexes: Array<Int>): Strategy() {
|
||||
|
||||
override fun getColors(): Array<Int> = colors
|
||||
|
||||
override fun getIndexes(): Array<Int> = indexes
|
||||
|
||||
override fun toString(): String {
|
||||
return indexes.joinToString(",")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
class SpeedUp(private val count: Int): Strategy() {
|
||||
override fun getColors(): Array<Int> = arrayOf(Colors.COLOR_BLUE_DARK, Colors.COLOR_TRANSPARENT)
|
||||
|
||||
override fun getIndexes(): Array<Int> = arrayOf(0, count)
|
||||
}
|
||||
|
||||
|
||||
object RouteStrategy {
|
||||
|
||||
private var strategy: Strategy? = null
|
||||
private var index: Int = 0
|
||||
|
||||
private var oldV: Double = NaN
|
||||
private var oldA: Double = NaN
|
||||
private var mode: Int = -1 // 0: 匀速, 1:减速, 2: 加速
|
||||
private val colors4SlowDown: LinkedList<Int> = LinkedList()
|
||||
private val colors4Uniform: LinkedList<Int> = LinkedList()
|
||||
private val indexes4SlowDown: LinkedList<Int> = LinkedList()
|
||||
private var isLightBlueAll = false
|
||||
private var isRedBlue = false
|
||||
private var ignore = false
|
||||
private var firstV: Double = NaN
|
||||
|
||||
private var isEnable = AppIdentityModeUtils.isTaxi(FunctionBuildConfig.appIdentityMode)
|
||||
|
||||
fun enable(enable: Boolean) {
|
||||
isEnable = enable
|
||||
}
|
||||
|
||||
fun start() {
|
||||
strategy = null
|
||||
index = 0
|
||||
mode = -1
|
||||
ignore = false
|
||||
colors4Uniform.clear()
|
||||
colors4SlowDown.clear()
|
||||
indexes4SlowDown.clear()
|
||||
isLightBlueAll = false
|
||||
isRedBlue = false
|
||||
oldA = NaN
|
||||
oldV = NaN
|
||||
firstV = NaN
|
||||
}
|
||||
|
||||
fun end() {
|
||||
strategy = acquireStrategy()
|
||||
}
|
||||
|
||||
private fun acquireStrategy(): Strategy? {
|
||||
if (mode == 0) {
|
||||
return if (colors4Uniform.isNotEmpty()) Uniform(index, colors = Array(colors4Uniform.size) {
|
||||
colors4Uniform[it]
|
||||
}) else null
|
||||
}
|
||||
if (mode == 2) {
|
||||
return SpeedUp(index)
|
||||
}
|
||||
|
||||
if (indexes4SlowDown.isEmpty() || !isLightBlueAll) {
|
||||
return null
|
||||
}
|
||||
val count = indexes4SlowDown.size
|
||||
if (count == 3) {
|
||||
val colors = when {
|
||||
isRedBlue -> {
|
||||
arrayOf(Colors.COLOR_RED_DARK, Colors.COLOR_BLUE_DARK, Colors.COLOR_BLUE_LIGHT, Colors.COLOR_TRANSPARENT)
|
||||
}
|
||||
else -> {
|
||||
return Uniform(index)
|
||||
}
|
||||
}
|
||||
val indexes = ArrayList<Int>()
|
||||
val i = indexes4SlowDown[2]
|
||||
if (index - i < 5) {
|
||||
return Uniform(index)
|
||||
}
|
||||
indexes += 0
|
||||
indexes += i
|
||||
indexes += i
|
||||
indexes += index
|
||||
return SlowDown(colors, indexes = indexes.toTypedArray())
|
||||
}
|
||||
return null
|
||||
}
|
||||
|
||||
fun check(speed: Double, acc: Double) {
|
||||
try {
|
||||
if (!isEnable){
|
||||
return
|
||||
}
|
||||
if (ignore) {
|
||||
return
|
||||
}
|
||||
if (oldV.isNaN()) {
|
||||
return
|
||||
}
|
||||
if (oldA.isNaN()) {
|
||||
return
|
||||
}
|
||||
if (index < 3) {
|
||||
//丢掉前3个点
|
||||
return
|
||||
}
|
||||
if (firstV.isNaN()) {
|
||||
firstV = speed;
|
||||
return
|
||||
}
|
||||
if (speed == oldV) {
|
||||
if (speed <= 0.01) {
|
||||
colors4Uniform.clear()
|
||||
colors4Uniform.add(Colors.COLOR_BLUE_LIGHT)
|
||||
colors4Uniform.add(Colors.COLOR_TRANSPARENT)
|
||||
}
|
||||
ignore = true
|
||||
mode = 0
|
||||
return
|
||||
}
|
||||
|
||||
if (speed > oldV) {
|
||||
mode = 2
|
||||
ignore = true
|
||||
return
|
||||
}
|
||||
|
||||
if (speed < oldV) {
|
||||
if (mode != 1) {
|
||||
indexes4SlowDown.add(0)
|
||||
mode = 1
|
||||
}
|
||||
}
|
||||
if (mode == 1) {
|
||||
if (!isLightBlueAll && speed <= 0.01) {
|
||||
isLightBlueAll = true
|
||||
indexes4SlowDown.add(index)
|
||||
ignore = true
|
||||
return
|
||||
}
|
||||
|
||||
if (!isRedBlue && firstV > 0 && speed > 0 && speed <= firstV / 2.0) {
|
||||
isRedBlue = true
|
||||
indexes4SlowDown.add(index)
|
||||
}
|
||||
}
|
||||
} finally {
|
||||
index++
|
||||
oldV = speed
|
||||
oldA = acc
|
||||
}
|
||||
}
|
||||
|
||||
fun getStrategy(): Strategy = if (isEnable) strategy ?: Uniform(index) else SpeedUp(index)
|
||||
}
|
||||
@@ -11,7 +11,6 @@ import com.apm.insight.log.VLog;
|
||||
import com.bytedance.apm.insight.ApmInsight;
|
||||
import com.bytedance.apm.insight.ApmInsightAgent;
|
||||
import com.bytedance.apm.insight.ApmInsightInitConfig;
|
||||
import com.mogo.cloud.passport.MoGoAiCloudClientConfig;
|
||||
import com.mogo.commons.constants.SharedPrefsConstants;
|
||||
import com.mogo.eagle.core.data.bindingcar.CarInfo;
|
||||
import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr;
|
||||
@@ -54,7 +53,10 @@ public class ApmCrashReportProvider implements ITestCrashReportProvider {
|
||||
HashMap<String, String> map = new HashMap<>();
|
||||
//车辆信息
|
||||
String carInfoString = SharedPrefsMgr.getInstance(context).getString(SharedPrefsConstants.CAR_INFO);
|
||||
CarInfo info = GsonUtils.fromJson(carInfoString, CarInfo.class);
|
||||
CarInfo info = null;
|
||||
if (carInfoString != null && !carInfoString.isEmpty()) {
|
||||
info = GsonUtils.fromJson(carInfoString, CarInfo.class);
|
||||
}
|
||||
|
||||
//地图版本
|
||||
String mapSDKVersion = AppUtils.getCustomMapSDKVersion(context);
|
||||
@@ -71,16 +73,21 @@ public class ApmCrashReportProvider implements ITestCrashReportProvider {
|
||||
String mapSDKVersion = AppUtils.getCustomMapSDKVersion(context);
|
||||
crash.config().setChannel("MAP_SDK_VERSION:"+mapSDKVersion);
|
||||
//可选,可以设置自定义did,不设置会使用内部默认的
|
||||
crash.config().setDeviceId(MoGoAiCloudClientConfig.getInstance().getSn());
|
||||
String sn = SharedPrefsMgr.getInstance(context).getString("sn");
|
||||
if (sn != null && !sn.isEmpty()) {
|
||||
crash.config().setDeviceId(sn);
|
||||
} else {
|
||||
crash.config().setDeviceId(DeviceIdUtils.getDeviceId(context));
|
||||
}
|
||||
crash.addTags(MAP_SDK_VERSION, mapSDKVersion);
|
||||
// crash.setReportUrl("www.xxx.com"); // 私有化部署:私有化部署才配置上报地址
|
||||
// crash.addTags("key", "value"); // 自定义筛选tag, 按需添加、可多次覆盖
|
||||
|
||||
HashMap<String, String> dimension = new HashMap<>();
|
||||
//维度值
|
||||
dimension.put("Devices_SN_DeviceId", MoGoAiCloudClientConfig.getInstance().getSn() + "__" + DeviceIdUtils.getDeviceId(context));
|
||||
dimension.put("Devices_SN_WidevineID_MD5", MoGoAiCloudClientConfig.getInstance().getSn() + "__" + DeviceIdUtils.getWidevineIDWithMd5(context));
|
||||
dimension.put("Devices_SN_WidevineID", MoGoAiCloudClientConfig.getInstance().getSn() + "__" + DeviceIdUtils.getWidevineID(context));
|
||||
dimension.put("Devices_SN_DeviceId", sn + "__" + DeviceIdUtils.getDeviceId(context));
|
||||
dimension.put("Devices_SN_WidevineID_MD5", sn + "__" + DeviceIdUtils.getWidevineIDWithMd5(context));
|
||||
dimension.put("Devices_SN_WidevineID", sn + "__" + DeviceIdUtils.getWidevineID(context));
|
||||
dimension.put(MAP_SDK_VERSION, mapSDKVersion);
|
||||
HashMap<String, Double> metric = new HashMap<>();
|
||||
//指标值
|
||||
|
||||
@@ -5,8 +5,8 @@ import android.text.TextUtils;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.alibaba.android.arouter.facade.template.IProvider;
|
||||
import com.mogo.cloud.passport.MoGoAiCloudClientConfig;
|
||||
import com.mogo.commons.debug.DebugConfig;
|
||||
import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr;
|
||||
import com.mogo.eagle.core.utilcode.util.AppUtils;
|
||||
import com.mogo.test.crashreport.CrashReportConstants;
|
||||
import com.tencent.bugly.Bugly;
|
||||
@@ -38,7 +38,10 @@ public class UpgradeReportProvider implements IProvider {
|
||||
String productFlavor = DebugConfig.getProductFlavor();
|
||||
strategy.setAppChannel(productFlavor);
|
||||
Bugly.init(context, CrashReportConstants.buglyAppID, true, strategy);
|
||||
Bugly.putUserData(context, "serial", MoGoAiCloudClientConfig.getInstance().getSn());
|
||||
String sn = SharedPrefsMgr.getInstance(context).getString("sn");
|
||||
if (sn != null && !sn.isEmpty()) {
|
||||
Bugly.putUserData(context, "serial", sn);
|
||||
}
|
||||
String mapSDKVersion = AppUtils.getCustomMapSDKVersion(context);
|
||||
Bugly.putUserData(context, "MAP_SDK_VERSION", mapSDKVersion);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user