Merge branch 'dev_robotaxi-d-app-module_290_220715_2.9.0' into 'test_robotaxi-d-app-module_290_220715_2.9.0.1'

Dev robotaxi d app module 290 220715 2.9.0

See merge request zhjt/AndroidApp/MoGoEagleEye!117
This commit is contained in:
pangfan
2022-08-05 03:44:44 +00:00
5 changed files with 60 additions and 89 deletions

View File

@@ -157,8 +157,8 @@ public class BusPassengerModel {
BusPassengerStation station = stations.get(i);
if (station.getDrivingStatus() == STATION_STATUS_STOPPED && station.isLeaving() && i+1 < stations.size()){
mRouteLineInfoCallback.updateStationsInfo(stations,i+1,false);
mTwoStationsRouts.clear();
if(mNextStationIndex != i+1){
mTwoStationsRouts.clear();
startRemainRouteInfo();
}
mNextStationIndex = i+1;

View File

@@ -539,8 +539,9 @@ public class BusOrderModel {
*/
private void startAutopilot(boolean isRestart) {
isArrivedStation = false;
triggerStartServiceEvent(isRestart, false);
isArrivedStation = false;
BusStationBean currentStation = stationList.get( backgroundCurrentStationIndex);
BusStationBean nextStation = stationList.get( backgroundCurrentStationIndex + 1);
@@ -573,8 +574,6 @@ public class BusOrderModel {
+" startLatLon="+currentStation.getName()+"endLatLon="+nextStation.getName());
CallerAutoPilotManager.INSTANCE.startAutoPilot(parameters);
triggerStartServiceEvent(isRestart, false);
if (mControllerStatusCallback != null) {
mControllerStatusCallback.startOpenAutopilot();
}
@@ -990,7 +989,7 @@ public class BusOrderModel {
}
public void triggerStartServiceEvent(boolean isRestart, boolean send) {
if (stationList == null || backgroundCurrentStationIndex >= stationList.size() || backgroundCurrentStationIndex == 0) {
if (stationList == null || backgroundCurrentStationIndex >= stationList.size()-1) {
return;
}
BusStationBean currentStation = stationList.get( backgroundCurrentStationIndex);

View File

@@ -41,6 +41,7 @@ import com.mogo.eagle.core.function.map.R;
import com.mogo.eagle.core.function.overview.InfStructureManager;
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils;
import com.mogo.eagle.core.utilcode.mogo.MapAssetStyleUtils;
import com.mogo.eagle.core.utilcode.util.UiThreadHandler;
import org.jetbrains.annotations.NotNull;
@@ -232,18 +233,22 @@ public class AMapCustomView
// 转成高德坐标系并存储
MarkerDrawerManager.INSTANCE.updateRoutePoints(list, mContext);
List<LatLng> planningPointList = MarkerDrawerManager.INSTANCE.getPlanningPoints();
displayCustomOverView();
drawStartAndEndMarker(planningPointList);
UiThreadHandler.post(() -> {
displayCustomOverView();
drawStartAndEndMarker(planningPointList);
});
MarkerDrawerManager.INSTANCE.setCallback((points, locIndex) -> {
// 每1s刷新一下轨迹线
if (points.size() > 0) {
drawPolyline(points, locIndex);
} else {
clearCustomPolyline();
}
UiThreadHandler.post(() -> {
if (points.size() > 0) {
drawPolyline(points, locIndex);
}
});
});
MarkerDrawerManager.INSTANCE.startLoopCalCarLocation();
drawInfrastructureMarkers(locationList);
UiThreadHandler.post(() -> {
drawInfrastructureMarkers(locationList);
});
}
@Override
@@ -264,11 +269,13 @@ public class AMapCustomView
public void onLocationChanged(@org.jetbrains.annotations.Nullable MogoLocation location, int from) {
mLocation = location;
MarkerDrawerManager.INSTANCE.setLonLat(new Pair(location.getLongitude(), location.getLatitude()));
drawCarMarker(location);
if (isFirstLocation) {
displayCustomOverView();
isFirstLocation = false;
}
UiThreadHandler.post(() -> {
drawCarMarker(location);
if (isFirstLocation) {
displayCustomOverView();
isFirstLocation = false;
}
});
}
public void onCreateView(Bundle savedInstanceState) {

View File

@@ -1,14 +1,12 @@
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.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.function.call.autopilot.CallerAutoPilotStatusListenerManager;
@@ -19,7 +17,6 @@ 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 java.util.LinkedList;
import java.util.List;
import mogo.telematics.pad.MessagePad;
@@ -29,33 +26,18 @@ public class RouteOverlayDrawer {
private static final String TAG = "MogoRouteOverlayManager";
// 连接线参数
private Handler mRenderHandler;
IMogoOverlayManager mogoOverlayManager;
private static volatile RouteOverlayDrawer sInstance;
private final MogoPolylineOptions mPolylineOptions;
private volatile IMogoPolyline mMoGoPolyline;
// private FileWriter writer;
private static final int COLOR_LIGHT = Color.parseColor("#BAEBF5");
private RouteOverlayDrawer() {
mPolylineOptions = new MogoPolylineOptions();
mPolylineOptions.zIndex(75000f);
mPolylineOptions.setGps(true);
mPolylineOptions.width(20).useGradient(true);
// try {
// File log = new File(Environment.getExternalStorageDirectory(), "log.txt");
// if (log.exists()) {
// log.delete();
// }
// if (log.getParentFile() != null && !log.getParentFile().exists()) {
// log.getParentFile().mkdirs();
// }
//
// log.createNewFile();
// writer = new FileWriter(log, false);
// } catch (Throwable t) {
//
// }
// 渐变色
mogoOverlayManager = MogoOverlayManager.getInstance();
// 线条粗细,渐变,渐变色值
@@ -191,48 +173,13 @@ public class RouteOverlayDrawer {
RouteStrategy.INSTANCE.end();
Strategy strategy = RouteStrategy.INSTANCE.getStrategy();
List<Integer> colors = strategy.getColors();
// StringBuilder sb = new StringBuilder();
// int colorIndex = 0;
// sb.append("=========================================\n");
// for (MogoLatLng p : points) {
// sb.append(p.lat);
// sb.append(",");
// sb.append(p.lon);
// sb.append(",");
// sb.append(p.acc);
// sb.append(",");
// sb.append(p.speed);
// if (colorIndex < colors.size()) {
// int color = colors.get(colorIndex);
// sb.append(",");
// sb.append(color);
// sb.append(",");
// sb.append(Color.red(color));
// sb.append(",");
// sb.append(Color.green(color));
// sb.append(",");
// sb.append(Color.blue(color));
// sb.append(",");
// sb.append(Color.alpha(color));
// colorIndex ++;
// }
// sb.append("\n");
// }
// try {
// if (writer != null) {
// writer.write(sb.toString());
// writer.flush();
// }
// } catch (Throwable t) {
//
// }
boolean isLightOn = strategy instanceof ColorfulStrategy && ((ColorfulStrategy) strategy).isLightOn();
if (mMoGoPolyline == null || mMoGoPolyline.isDestroyed()) {
mPolylineOptions.points(points);
mPolylineOptions.colorValues(colors);
if (isLightOn) {
mPolylineOptions.openBright(true);
mPolylineOptions.brightColor(Color.parseColor("#D2F2F8"));
mPolylineOptions.brightColor(COLOR_LIGHT);
mPolylineOptions.brightSpeed(0.5f);
} else {
mPolylineOptions.openBright(false);
@@ -243,7 +190,7 @@ public class RouteOverlayDrawer {
mPolylineOptions.colorValues(colors);
if (isLightOn) {
mPolylineOptions.openBright(true);
mPolylineOptions.brightColor(Color.parseColor("#D2F2F8"));
mPolylineOptions.brightColor(COLOR_LIGHT);
mPolylineOptions.brightSpeed(0.5f);
} else {
mPolylineOptions.openBright(false);

View File

@@ -38,6 +38,10 @@ public class ApmCrashReportProvider implements ITestCrashReportProvider {
private static final String TAG = "ApmCrashReportProvider";
private static final String MAP_SDK_VERSION = "MAP_SDK_VERSION";
private CarInfo mInfo = null;
private String mCityCode;
private String mLat;
private String mLogt;
@Override
public void init(Context context) {
@@ -54,27 +58,28 @@ public class ApmCrashReportProvider implements ITestCrashReportProvider {
HashMap<String, String> map = new HashMap<>();
//车辆信息
String carInfoString = SharedPrefsMgr.getInstance(context).getString(SharedPrefsConstants.CAR_INFO);
CarInfo info = null;
if (carInfoString != null && !carInfoString.isEmpty()) {
info = GsonUtils.fromJson(carInfoString, CarInfo.class);
mInfo = GsonUtils.fromJson(carInfoString, CarInfo.class);
}
//车辆所在位置
String cityCode = SharedPrefsMgr.getInstance(context).getString(SharedPrefsConstants.LOCATION_CITY_CODE);
String lat = SharedPrefsMgr.getInstance(context).getString(SharedPrefsConstants.LOCATION_LATITUDE);
String logt = SharedPrefsMgr.getInstance(context).getString(SharedPrefsConstants.LOCATION_LONGITUDE);
// Log.d("liyz", "cityCode = " + cityCode + " --lat = " +lat + " --logt = " + logt);
mCityCode = SharedPrefsMgr.getInstance(context).getString(SharedPrefsConstants.LOCATION_CITY_CODE);
mLat = SharedPrefsMgr.getInstance(context).getString(SharedPrefsConstants.LOCATION_LATITUDE);
mLogt = SharedPrefsMgr.getInstance(context).getString(SharedPrefsConstants.LOCATION_LONGITUDE);
// Log.d("liyz", "cityCode = " + mCityCode + " --lat = " +mLat + " --logt = " + mLogt);
//地图版本
String mapSDKVersion = AppUtils.getCustomMapSDKVersion(context);
map.put("MAP_SDK_VERSION", mapSDKVersion);
if (info != null) {
CallerLogger.INSTANCE.d(TAG, "nuber = " + info.getNumber_plate() + "--brand = " + info.getBrand() + "--modle = " + info.getModel());
map.put("PLATE_NUMBER", info.getNumber_plate());
map.put("BRAND", info.getBrand());
map.put("MODEL", info.getModel());
map.put("CITYCODE", cityCode);
map.put("LATITUDE", lat);
map.put("LONGITUTE", logt);
map.put("CITYCODE", mCityCode);
map.put("LATITUDE", mLat);
map.put("LONGITUTE", mLogt);
if (mInfo != null) {
CallerLogger.INSTANCE.d(TAG, "nuber = " + mInfo.getNumber_plate() + "--brand = " + mInfo.getBrand() + "--modle = " + mInfo.getModel());
map.put("PLATE_NUMBER", mInfo.getNumber_plate());
map.put("BRAND", mInfo.getBrand());
map.put("MODEL", mInfo.getModel());
}
return map;
}
@@ -89,6 +94,10 @@ public class ApmCrashReportProvider implements ITestCrashReportProvider {
crash.config().setDeviceId(DeviceIdUtils.getDeviceId(context));
}
crash.addTags(MAP_SDK_VERSION, mapSDKVersion);
crash.addTags("CITYCODE", mCityCode);
crash.addTags("LATITUDE", mLat);
crash.addTags("LONGITUTE", mLogt);
// crash.setReportUrl("www.xxx.com"); // 私有化部署:私有化部署才配置上报地址
// crash.addTags("key", "value"); // 自定义筛选tag, 按需添加、可多次覆盖
@@ -98,6 +107,15 @@ public class ApmCrashReportProvider implements ITestCrashReportProvider {
dimension.put("Devices_SN_WidevineID_MD5", sn + "__" + DeviceIdUtils.getWidevineIDWithMd5(context));
dimension.put("Devices_SN_WidevineID", sn + "__" + DeviceIdUtils.getWidevineID(context));
dimension.put(MAP_SDK_VERSION, mapSDKVersion);
dimension.put("CITYCODE", mCityCode);
dimension.put("LATITUDE", mLat);
dimension.put("LONGITUTE", mLogt);
if (mInfo != null) {
dimension.put("PLATE_NUMBER", mInfo.getNumber_plate());
dimension.put("BRAND", mInfo.getBrand());
dimension.put("MODEL", mInfo.getModel());
}
HashMap<String, Double> metric = new HashMap<>();
//指标值
//metric.put("Devices_ID_metric", (double) 100);