Merge remote-tracking branch 'remotes/origin/dev_hengyang_base' into dev_yingyan_och

# Conflicts:
#	OCH/mogo-och/src/main/res/drawable/module_mogo_och_autopilot_status_bg.xml
This commit is contained in:
lianglihui
2021-06-21 10:17:04 +08:00
71 changed files with 1003 additions and 300 deletions

2
.idea/misc.xml generated
View File

@@ -8,7 +8,7 @@
<asm skipDebug="false" skipFrames="false" skipCode="false" expandFrames="false" />
<groovy codeStyle="LEGACY" />
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<component name="ProjectRootManager" version="2" languageLevel="JDK_11" default="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/build/classes" />
</component>
</project>

View File

@@ -3,6 +3,7 @@
<component name="RunConfigurationProducerService">
<option name="ignoredProducers">
<set>
<option value="com.android.tools.idea.compose.preview.runconfiguration.ComposePreviewRunConfigurationProducer" />
<option value="org.jetbrains.plugins.gradle.execution.test.runner.AllInPackageGradleConfigurationProducer" />
<option value="org.jetbrains.plugins.gradle.execution.test.runner.TestClassGradleConfigurationProducer" />
<option value="org.jetbrains.plugins.gradle.execution.test.runner.TestMethodGradleConfigurationProducer" />

View File

@@ -4,6 +4,9 @@ apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'android-aspectjx'
Properties properties = new Properties();
properties.load(project.rootProject.file("gradle.properties").newDataInputStream())
android {
compileSdkVersion rootProject.ext.android.compileSdkVersion
defaultConfig {
@@ -43,6 +46,9 @@ android {
zipAlignEnabled false
shrinkResources false
signingConfig signingConfigs.release
manifestPlaceholders =[
MAP_SDK_VERSION : properties.getProperty("MAP_SDK_VERSION")
]
}
release {
minifyEnabled false
@@ -105,6 +111,7 @@ android {
buildConfigField 'String', 'SOCKET_APP_ID', '\"com.mogo.launcher\"'
// 是否支持目的地导航策略
buildConfigField 'boolean', 'IS_SUPPORT_SCHEDULE_CALCULATE_NOT_HOME_COMPANY_DISTANCE_FOR_PUSH', 'false'
}
// f系列-网约车-出租车
fochtaxi {
@@ -241,7 +248,7 @@ android {
// 车机类型主要用于区分自研车机还是别人家的车机自研车机类型为0
buildConfigField 'int', 'CAR_MACHINE_TYPE', '2'
buildConfigField 'boolean', 'ROAD_EVENT_ANIMATED', 'true'
manifestPlaceholders = [AMAP_API_VALUE: rootProject.ext.android.fLauncherAmapApiValue,CHANNEL_VALUE: "f8xx"]
manifestPlaceholders = [AMAP_API_VALUE: rootProject.ext.android.fLauncherAmapApiValue,CHANNEL_VALUE: "fPadLenovo"]
// 是否使用高德sdk自定义导航
buildConfigField 'boolean', 'USE_CUSTOM_NAVI', 'false'
// 是否支持换肤
@@ -261,7 +268,7 @@ android {
// 是否需要使用工控机的rtk定位
buildConfigField 'boolean', 'IS_USE_ADAS_RTK_LOCATION_INFO', 'true'
}
// f系列-网约车-出租车
// 衡阳-联想Pad-网约车-出租车
fPadLenovoOchTaxi {
minSdkVersion rootProject.ext.android.minSdkVersionPadLenovo
targetSdkVersion rootProject.ext.android.targetSdkVersionPadLenovo
@@ -272,7 +279,7 @@ android {
// 车机类型主要用于区分自研车机还是别人家的车机自研车机类型为0
buildConfigField 'int', 'CAR_MACHINE_TYPE', '2'
buildConfigField 'boolean', 'ROAD_EVENT_ANIMATED', 'true'
manifestPlaceholders = [AMAP_API_VALUE: rootProject.ext.android.fLauncherAmapApiValue, CHANNEL_VALUE: "fochtaxi"]
manifestPlaceholders = [AMAP_API_VALUE: rootProject.ext.android.fLauncherAmapApiValue, CHANNEL_VALUE: "fPadLenovoOchTaxi"]
// 是否使用高德sdk自定义导航
buildConfigField 'boolean', 'USE_CUSTOM_NAVI', 'false'
// 是否支持换肤
@@ -292,7 +299,7 @@ android {
// 是否需要使用工控机的rtk定位
buildConfigField 'boolean', 'IS_USE_ADAS_RTK_LOCATION_INFO', 'true'
}
// f系列-网约车-小巴车
// 衡阳-联想Pad-网约车-小巴车
fPadLenovoOchBus {
minSdkVersion rootProject.ext.android.minSdkVersionPadLenovo
targetSdkVersion rootProject.ext.android.targetSdkVersionPadLenovo
@@ -303,7 +310,7 @@ android {
// 车机类型主要用于区分自研车机还是别人家的车机自研车机类型为0
buildConfigField 'int', 'CAR_MACHINE_TYPE', '2'
buildConfigField 'boolean', 'ROAD_EVENT_ANIMATED', 'true'
manifestPlaceholders = [AMAP_API_VALUE: rootProject.ext.android.fLauncherAmapApiValue,CHANNEL_VALUE: "fochbus"]
manifestPlaceholders = [AMAP_API_VALUE: rootProject.ext.android.fLauncherAmapApiValue,CHANNEL_VALUE: "fPadLenovoOchBus"]
// 是否使用高德sdk自定义导航
buildConfigField 'boolean', 'USE_CUSTOM_NAVI', 'false'
// 是否支持换肤

View File

@@ -32,13 +32,13 @@ project.dependencies {
em4Implementation project(':foudations:mogo-aicloud-services-apk')
e8xxImplementation project(':foudations:mogo-aicloud-services-apk')
f8xxImplementation project(':foudations:mogo-aicloud-services-apk')
fPadLenovoImplementation project(':foudations:mogo-aicloud-services-apk')
fPadLenovoImplementation project(':foudations:mogo-aicloud-services-sdk')
f80xImplementation project(':foudations:mogo-aicloud-services-apk')
f8AmapImplementation project(':foudations:mogo-aicloud-services-apk')
em3Implementation project(':foudations:mogo-aicloud-services-apk')
fochtaxiImplementation project(':foudations:mogo-aicloud-services-apk')
fochbusImplementation project(':foudations:mogo-aicloud-services-apk')
fPadLenovoOchTaxiImplementation project(':foudations:mogo-aicloud-services-apk')
fPadLenovoOchBusImplementation project(':foudations:mogo-aicloud-services-apk')
fPadLenovoOchTaxiImplementation project(':foudations:mogo-aicloud-services-sdk')
fPadLenovoOchBusImplementation project(':foudations:mogo-aicloud-services-sdk')
}
}

View File

@@ -29,6 +29,10 @@
<meta-data
android:name="com.amap.api.v2.apikey"
android:value="${AMAP_API_VALUE}" />
<meta-data
android:name="MAP_SDK_VERSION"
android:value="${MAP_SDK_VERSION}" />
<!--保活用-->
<service
android:name="com.zhidao.boot.persistent.lib.PersistentAliveService"

View File

@@ -282,7 +282,7 @@ public class MogoApplication extends AbsMogoApplication {
startService(intent);
}
if (refWatcher != null){
if (refWatcher == null){
refWatcher = LeakCanary.install(this);
}

View File

@@ -97,6 +97,8 @@ ext {
mapcustom : "com.mogo.map:map-custom:${MAP_CUSTOM_VERSION}",
mogomap : "com.mogo.map:mogo-map:${MOGO_MAP_VERSION}",
mogomapapi : "com.mogo.map:mogo-map-api:${MOGO_MAP_API_VERSION}",
mogocustommap : "com.zhidaoauto.machine:map:${MAP_SDK_VERSION}",
modulecommon : "com.mogo.module:module-common:${MOGO_MODULE_COMMON_VERSION}",
modulemain : "com.mogo.module:module-main:${MOGO_MODULE_MAIN_VERSION}",
modulemainlauncher : "com.mogo.module:module-main-launcher:${MOGO_MODULE_MAIN_LAUNCHER_VERSION}",
@@ -169,6 +171,9 @@ ext {
// obu sdk
obusdk : "com.zhidao.enterprise.smartv2x:smartv2x:1.0.0.3",
// mebulaobu : 'com.zhidao.support.nebulaobu:nebulaobu:1.0.0.3',
mogoobu : 'com.zhidao.support.obu:mogoobu:1.0.0.2',
// 左侧面板
moduleleftpanel : "com.mogo.module:module-left-panel:${MOGO_MODULE_LEFT_PANEL_VERSION}",
// 左侧面板空实现

View File

@@ -38,6 +38,8 @@ dependencies {
implementation project(":foudations:mogo-commons")
implementation project(":services:mogo-service-api")
}
annotationProcessor 'com.elegant.spi:compiler:1.0.3'
}
apply from: new File(rootProject.rootDir, "gradle/upload.gradle").toString()

View File

@@ -6,7 +6,9 @@ import android.content.Context;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.os.Bundle;
import android.text.TextUtils;
import android.util.Log;
import java.util.List;
@@ -58,6 +60,25 @@ public class AppUtils {
}
}
private static final String MOGO_MAP_SDK_VERSION = "MAP_SDK_VERSION";
public static String getCustomMapSDKVersion(Context context){
return getApplicationMetaValue(context,MOGO_MAP_SDK_VERSION);
}
private static String getApplicationMetaValue(Context context,String metaName){
try {
ApplicationInfo applicationInfo = context.getPackageManager().getApplicationInfo(context.getPackageName(),PackageManager.GET_META_DATA);
Bundle bundle = applicationInfo.metaData;
if (bundle != null){
return bundle.getString(metaName);
}
} catch (PackageManager.NameNotFoundException e) {
e.printStackTrace();
}
return "";
}
public static boolean isAppForeground( Context context ) {
if ( context != null ) {
ActivityManager activityManager = ( ActivityManager ) context.getSystemService( Context.ACTIVITY_SERVICE );

View File

@@ -66,8 +66,8 @@ dependencies {
implementation project(':libraries:mogo-map-api')
implementation project(':foudations:mogo-commons')
}
implementation 'com.zhidaoauto.machine:map:1.0.0-vr-8.5.44'
implementation rootProject.ext.dependencies.mogocustommap
// implementation 'com.zhidaoauto.machine:map:1.0.0-vr-8.5.47'
// implementation 'com.zhidaoauto.machine:map:1.0.0-vr-test-3.4'
}

View File

@@ -76,4 +76,16 @@ mapAutoView.getMapAutoViewHelper()?.setNearViewAnglePositionLonLatPoint(112.5
8.5.40
修改崩溃bug
更新路牌数据
修改近视角切换
修改近视角切换
8.5.47
修改绿化带相关
修改crash bug
更新衡阳数据
8.5.48
fix crash
8.5.49
1.更新衡阳数据包含38Km和城区200km
2.新增路牌

View File

@@ -353,6 +353,9 @@ public class AMapViewWrapper implements IMogoMapView,
setUIMode(ui);
break;
case Type_VR:
if (DebugConfig.getCarMachineType() == DebugConfig.CAR_MACHINE_TYPE_LENOVO) {
mMapView.getMapAutoViewHelper().setScaleVRMode(true);
}
mMapView.getMapAutoViewHelper().setMapStyle(MapAutoApi.MAP_STYLE_VR);
return;
case Type_Light:

View File

@@ -100,6 +100,7 @@ public class ObjectUtils {
.setFlat( opt.isFlat() )
.visible( opt.isVisible() )
.infoWindowEnable( opt.isInifoWindowEnable() )
.scale(opt.getScale())
.alpha( opt.getAlpha() )
// .draggable( opt.isDraggable() )
.setInfoWindowOffset( opt.getOffsetX(), opt.getOffsetY() )

View File

@@ -43,6 +43,9 @@ public class MogoMarkerOptions extends Observable {
// 设置Marker覆盖物的透明度
private float alpha = 1.0f;
// 设置Marker覆盖物的缩放
private float scale = 1.0f;
// Marker覆盖物的坐标是否是Gps
private boolean isGps = false;
@@ -220,6 +223,12 @@ public class MogoMarkerOptions extends Observable {
return this;
}
public MogoMarkerOptions scale( float scale ) {
this.scale = scale;
return this;
}
public MogoMarkerOptions gps( boolean gps ) {
isGps = gps;
return this;
@@ -326,6 +335,10 @@ public class MogoMarkerOptions extends Observable {
return alpha;
}
public float getScale() {
return scale;
}
public boolean isGps() {
return isGps;
}
@@ -403,6 +416,7 @@ public class MogoMarkerOptions extends Observable {
", visible=" + visible +
", inifoWindowEnable=" + inifoWindowEnable +
", alpha=" + alpha +
" ,scale=" + scale+
", isGps=" + isGps +
", u=" + u +
", v=" + v +

View File

@@ -38,7 +38,7 @@ dependencies {
implementation rootProject.ext.dependencies.androidxappcompat
implementation rootProject.ext.dependencies.androidxconstraintlayout
implementation rootProject.ext.dependencies.arouter
implementation rootProject.ext.dependencies.rxandroid
annotationProcessor rootProject.ext.dependencies.aroutercompiler

View File

@@ -0,0 +1,11 @@
package com.mogo.module.adas;
/**
* Created by XuYong on 2021/5/28 15:24
*/
public class AdasConstant {
public static final String HOST_DEV = "http://dzt-test.zhidaohulian.com";
public static final String HOST_TEST = "http://dzt-test.zhidaohulian.com";
public static final String HOST_DEMO = "http://dzt-show.zhidaohulian.com";
public static final String HOST_PRODUCT = "https://dzt.zhidaohulian.com";
}

View File

@@ -1,7 +1,14 @@
package com.mogo.module.adas;
import android.os.RemoteException;
import com.google.gson.Gson;
import com.mogo.cloud.passport.MoGoAiCloudClientConfig;
import com.mogo.commons.data.BaseData;
import com.mogo.commons.network.SubscribeImpl;
import com.mogo.module.common.MogoApisHandler;
import com.mogo.utils.logger.Logger;
import com.mogo.utils.network.RequestOptions;
import com.mogo.utils.network.utils.GsonUtil;
import com.zhidao.autopilotservice.model.AdasAIDLAutopilotArriveModel;
import com.zhidao.autopilotservice.model.AdasAIDLAutopilotStateModel;
@@ -18,6 +25,18 @@ import com.zhidao.support.adas.high.bean.WarnMessageInfo;
import com.zhidao.support.adas.high.common.MsgActionType;
import java.util.ArrayList;
import java.util.concurrent.TimeUnit;
import io.reactivex.Flowable;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.annotations.NonNull;
import io.reactivex.disposables.Disposable;
import io.reactivex.functions.Consumer;
import io.reactivex.schedulers.Schedulers;
import okhttp3.MediaType;
import okhttp3.RequestBody;
import static com.mogo.commons.context.ContextHolderUtil.getContext;
/**
* Created by XuYong on 2021/4/25 14:43
@@ -25,14 +44,22 @@ import java.util.ArrayList;
public class AdasEventManager implements OnAdasListener, OnAdasMsgConnectStatusListener {
private final String TAG = "AdasEventManager";
private final Gson gson;
private final ArrayList<AdasDataListener> iAdasEventListeners = new ArrayList<>();
private final ArrayList<AdasStatusListener> iAdasStatusListeners = new ArrayList<>();
private IAdasApiService mAdasApiService;
private Disposable uploadAutopilotStatus;
//自动驾驶状态
private int mCurrentAutopilotStatus = -1;
//自动驾驶车速度
private float mCurrentAutopilotSpeed = 0;
private Disposable mdDisposable;
//自动驾驶状态
private AutopilotStatus.ValuesBean mAutopilotStatus = null;
public AdasEventManager() {
gson = GsonUtil.getGson();
mAdasApiService = MogoApisHandler.getInstance().getApis().getNetworkApi().create( IAdasApiService.class, AdasConstant.HOST_PRODUCT );
}
public void addEventListener(AdasDataListener listener) {
@@ -65,6 +92,11 @@ public class AdasEventManager implements OnAdasListener, OnAdasMsgConnectStatusL
}
}
public void removeStatusListener() {
Logger.d(TAG,"注销adas状态事件监听");
iAdasStatusListeners.clear();
}
@Override
public void onWarnMessage(WarnMessageInfo warnMessageInfo) {
Logger.d(TAG,"onWarnMessage " + warnMessageInfo);
@@ -145,7 +177,6 @@ public class AdasEventManager implements OnAdasListener, OnAdasMsgConnectStatusL
AutopilotStatus.ValuesBean autopilotStatusValues = autopilotStatus.getValues();
AutopilotStatus.ValuesBean mAutopilotStatus;
if (autopilotStatusValues != null) {
AdasAIDLAutopilotStateModel adasAIDLAutopilotStateModel=new AdasAIDLAutopilotStateModel();
adasAIDLAutopilotStateModel.setReason(autopilotStatusValues.getReason());
@@ -154,14 +185,15 @@ public class AdasEventManager implements OnAdasListener, OnAdasMsgConnectStatusL
float speed = autopilotStatusValues.getSpeed();
adasAIDLAutopilotStateModel.setState(state);
adasAIDLAutopilotStateModel.setSpeed(speed);
mCurrentAutopilotStatus = state;
mCurrentAutopilotSpeed = speed;
for (AdasDataListener listener:iAdasEventListeners) {
if (listener != null) {
listener.notifyAutopilotState(adasAIDLAutopilotStateModel);
}
}
}
}
}
@Override
@@ -174,8 +206,12 @@ public class AdasEventManager implements OnAdasListener, OnAdasMsgConnectStatusL
if (endLatLon != null) {
AdasAIDLAutopilotArriveModel adasAIDLAutopilotArriveModel = new AdasAIDLAutopilotArriveModel();
adasAIDLAutopilotArriveModel.setCarType(result.getCarType());
adasAIDLAutopilotArriveModel.setLat(endLatLon.getLat());
adasAIDLAutopilotArriveModel.setLon(endLatLon.getLon());
double lon = endLatLon.getLon();
double lat = endLatLon.getLat();
adasAIDLAutopilotArriveModel.setLat(lat);
adasAIDLAutopilotArriveModel.setLon(lon);
Logger.d(TAG,"autopilotArrive reportSite");
reportSite(lon, lat);
for (AdasDataListener listener:iAdasEventListeners) {
if (listener != null) {
listener.autopilotArrive(adasAIDLAutopilotArriveModel);
@@ -197,6 +233,7 @@ public class AdasEventManager implements OnAdasListener, OnAdasMsgConnectStatusL
for (AdasStatusListener listener :iAdasStatusListeners) {
listener.onServiceConnected();
}
updateDriveStatusTask();
}
@Override
@@ -206,4 +243,78 @@ public class AdasEventManager implements OnAdasListener, OnAdasMsgConnectStatusL
listener.onServiceDisconnected();
}
}
public void updateDriveStatusTask() {
Logger.d(TAG,"updateDriveStatusTask");
mdDisposable = Flowable.interval(0,5, TimeUnit.SECONDS)
.subscribeOn(Schedulers.io())
.unsubscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new Consumer<Long>() {
@Override
public void accept(@NonNull Long aLong) throws Exception {
updateDriveStatus();
}
});
}
private void updateDriveStatus() {
String sn = MoGoAiCloudClientConfig.getInstance().getSn();
AutonomousDriveStatusBean request = new AutonomousDriveStatusBean(sn, mCurrentAutopilotStatus, mCurrentAutopilotSpeed);
RequestBody requestBody = RequestBody.create( MediaType.get( "application/json;charset=UTF-8" ), GsonUtil.jsonFromObject( request ) );
mAdasApiService.updateAutonomousDriveStatus(requestBody).
subscribeOn( Schedulers.io() ).observeOn( AndroidSchedulers.mainThread() )
.subscribe(new SubscribeImpl<BaseData>(RequestOptions.create(getContext())) {
@Override
public void onError(String message, int code) {
super.onError(message, code);
}
@Override
public void onError(Throwable e) {
super.onError(e);
}
@Override
public void onSuccess(BaseData o) {
super.onSuccess(o);
Logger.d(TAG,"updateDriveStatus success");
}
});
}
private void reportSite( double lon, double lat) {
String sn = MoGoAiCloudClientConfig.getInstance().getSn();
ReportSiteBean reportSiteBean = new ReportSiteBean(sn, lon, lat);
RequestBody requestBody = RequestBody.create( MediaType.get( "application/json;charset=UTF-8" ), GsonUtil.jsonFromObject( reportSiteBean ) );
mAdasApiService.updateReportSite(requestBody).
subscribeOn( Schedulers.io() ).observeOn( AndroidSchedulers.mainThread() )
.subscribe(new SubscribeImpl<BaseData>(RequestOptions.create(getContext())) {
@Override
public void onError(String message, int code) {
super.onError(message, code);
}
@Override
public void onError(Throwable e) {
super.onError(e);
}
@Override
public void onSuccess(BaseData o) {
super.onSuccess(o);
Logger.d(TAG,"autopilotArrive success");
}
});
}
public AdasAIDLAutopilotStateModel autopilotStateCall() {
AdasAIDLAutopilotStateModel adasAIDLAutopilotStateModel=new AdasAIDLAutopilotStateModel();
if (mAutopilotStatus != null) {
adasAIDLAutopilotStateModel.setSpeed(mAutopilotStatus.getSpeed());
adasAIDLAutopilotStateModel.setState(mAutopilotStatus.getState());
adasAIDLAutopilotStateModel.setReason(mAutopilotStatus.getReason());
}
return adasAIDLAutopilotStateModel;
}
}

View File

@@ -6,6 +6,8 @@ import com.alibaba.android.arouter.facade.annotation.Route;
import com.alibaba.android.arouter.facade.template.IProvider;
import com.mogo.service.MogoServicePaths;
import com.mogo.utils.logger.Logger;
import com.zhidao.autopilot.support.api.AutopilotServiceManage;
import com.zhidao.autopilotservice.model.AdasAIDLAutopilotStateModel;
import com.zhidao.support.adas.high.AdasManager;
@@ -51,8 +53,46 @@ public class AdasProvider implements IProvider {
adasEventManager.removeStatusListener(listener);
}
public void removeAdasStatusListener() {
adasEventManager.removeStatusListener();
}
public void sendWsMessage(String msg) {
AdasManager.getInstance().aiCloudToAdasData(msg);
}
public void cancelPolit() {
if (AdasManager.getInstance().isSocketConnect()) {
AdasManager.getInstance().controlAutopilotCarHead();
}
}
public void hideAdas() {
}
public void showAdas() {
}
public void killAdas() {
}
//原ADAS sdk中为空实现
public void settingCarModelListInfo(String msg) {
}
//原ADAS sdk中为空实现
public void setSettingStatus(boolean show) {
}
//原ADAS sdk中为空实现
public void setUseAlgorithm(boolean open) {
}
public AdasAIDLAutopilotStateModel autopilotStateCall() {
return adasEventManager.autopilotStateCall();
}
}

View File

@@ -0,0 +1,41 @@
package com.mogo.module.adas;
/**
* Created by XuYong on 2021/5/28 16:12
*/
public class AutonomousDriveStatusBean {
private String sn;
private int status;
private float vehicleSpeed;
public AutonomousDriveStatusBean(String sn, int status, float vehicleSpeed) {
this.sn = sn;
this.status = status;
this.vehicleSpeed = vehicleSpeed;
}
public String getSn() {
return sn;
}
public void setSn(String sn) {
this.sn = sn;
}
public int getStatus() {
return status;
}
public void setStatus(int status) {
this.status = status;
}
public float getVehicleSpeed() {
return vehicleSpeed;
}
public void setVehicleSpeed(float vehicleSpeed) {
this.vehicleSpeed = vehicleSpeed;
}
}

View File

@@ -0,0 +1,24 @@
package com.mogo.module.adas;
import com.mogo.commons.data.BaseData;
import io.reactivex.Observable;
import okhttp3.RequestBody;
import retrofit2.http.Body;
import retrofit2.http.Headers;
import retrofit2.http.POST;
/**
* Created by XuYong on 2021/5/28 14:24
*/
public interface IAdasApiService {
//上传自动驾驶状态接口
@Headers( {"Content-Type:application/json;charset=UTF-8"} )
@POST( "/yycp-carDataService/autonomousDrive/updateAutonomousDriveStatus" )
Observable<BaseData> updateAutonomousDriveStatus(@Body RequestBody requestBody );
//站点上报
@Headers( {"Content-Type:application/json;charset=UTF-8"} )
@POST( "/yycp-carDataService/autonomousDrive/reportSite" )
Observable<BaseData> updateReportSite(@Body RequestBody requestBody );
}

View File

@@ -0,0 +1,40 @@
package com.mogo.module.adas;
/**
* Created by XuYong on 2021/5/31 16:24
*/
public class ReportSiteBean {
private String sn;
private double lon;
private double lat;
public ReportSiteBean(String sn, double lon, double lat) {
this.sn = sn;
this.lon = lon;
this.lat = lat;
}
public String getSn() {
return sn;
}
public void setSn(String sn) {
this.sn = sn;
}
public double getLon() {
return lon;
}
public void setLon(double lon) {
this.lon = lon;
}
public double getLat() {
return lat;
}
public void setLat(double lat) {
this.lat = lat;
}
}

View File

@@ -2,6 +2,7 @@ package com.mogo.module.common.dialog;
import android.app.Dialog;
import android.content.Context;
import android.os.Build;
import android.view.WindowManager;
import androidx.annotation.NonNull;
@@ -32,7 +33,11 @@ public class BaseFloatDialog extends Dialog {
}
private void addFlag() {
getWindow().setType(WindowManager.LayoutParams.TYPE_SYSTEM_ALERT);
if ( Build.VERSION.SDK_INT >= Build.VERSION_CODES.O ) {
getWindow().setType(WindowManager.LayoutParams.TYPE_APPLICATION_OVERLAY);
} else {
getWindow().setType(WindowManager.LayoutParams.TYPE_SYSTEM_ALERT);
}
getWindow().addFlags(WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN
| WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION
| WindowManager.LayoutParams.FLAG_LOCAL_FOCUS_MODE);

View File

@@ -275,6 +275,7 @@ class AdasRecognizedResultDrawer extends BaseDrawer {
final long start = System.currentTimeMillis();
Log.d("EmArrow", "renderAdasOneFrame uuid : " + uniqueKey + " type : " + recognizedListResult.type);
Log.d("EmArrow", "renderAdasOneFrame Process.myPid : " + android.os.Process.myPid());
ADASRecognizedResult lastPosition = mLastPositions.remove(uniqueKey);
// double lastLon = -1;
// double lastLat = -1;

View File

@@ -180,11 +180,9 @@ class BaseDrawer {
AdasRecognizedType recognizedType = AdasRecognizedType.valueFrom(type);
if (recognizedType == AdasRecognizedType.classIdCar) {
return R.raw.othercar;
} else if (recognizedType == AdasRecognizedType.classIdTrafficBus
|| recognizedType == AdasRecognizedType.classIdTrafficTruck) {
} else if (recognizedType == AdasRecognizedType.classIdTrafficBus) {
return R.raw.bus;
} else if (recognizedType == AdasRecognizedType.classIdBicycle
|| recognizedType == AdasRecognizedType.classIdMoto) {
} else if (recognizedType == AdasRecognizedType.classIdMoto) {
return R.raw.motorbike;
} else if (recognizedType == AdasRecognizedType.classIdStopLine) {
return R.raw.stopline;
@@ -192,6 +190,10 @@ class BaseDrawer {
return R.raw.arraw;
} else if (recognizedType == AdasRecognizedType.classIdUnKnow) {
return R.raw.tache;
}else if(recognizedType == AdasRecognizedType.classIdBicycle){
return R.raw.zixingche;
}else if(recognizedType == AdasRecognizedType.classIdTrafficTruck){
return R.raw.kache;
}
return R.raw.people;
}

View File

@@ -54,6 +54,7 @@ public class V2XWarningEntity implements Serializable {
public long satelliteTime;
//预警蒙层等展示时长
private long showTime;
//设计划线宽度与道路同宽
private float roadwidth;
//自组字段

Binary file not shown.

View File

@@ -6,4 +6,10 @@
<dimen name="module_v2n_tip_text_width">106px</dimen>
<dimen name="module_v2n_tip_text_margin_right">52px</dimen>
<dimen name="module_v2n_image_margin_left">37px</dimen>
<dimen name="module_v2x_brake_tip_width">435px</dimen>
<dimen name="module_v2x_brake_tip_height">186px</dimen>
<dimen name="module_v2x_brake_image_width">133px</dimen>
<dimen name="module_v2x_brake_image_margin_left">37px</dimen>
<dimen name="module_v2x_brake_image_margin_right">27px</dimen>
</resources>

View File

@@ -1128,6 +1128,10 @@
<dimen name="module_v2n_tip_text_width">100px</dimen>
<dimen name="module_v2n_tip_text_margin_right">28px</dimen>
<dimen name="module_v2n_image_margin_left">28px</dimen>
<dimen name="module_v2x_brake_tip_width">320px</dimen>
<dimen name="module_v2x_brake_tip_height">140px</dimen>
<dimen name="module_v2x_brake_image_margin_left">28px</dimen>
<dimen name="module_v2x_brake_image_margin_right">20px</dimen>
<dimen name="module_v2x_brake_image_width">100px</dimen>
</resources>

View File

@@ -59,6 +59,8 @@ dependencies {
api rootProject.ext.dependencies.mogoserviceapi
implementation rootProject.ext.dependencies.modulecommon
implementation rootProject.ext.dependencies.moduleshare
implementation rootProject.ext.dependencies.moduleservice
// implementation rootProject.ext.dependencies.moduleventpanel
// implementation rootProject.ext.dependencies.mogomoduleauth
} else {
@@ -69,6 +71,7 @@ dependencies {
api project(':services:mogo-service-api')
implementation project(':modules:mogo-module-common')
implementation project(':modules:mogo-module-share')
implementation project(':modules:mogo-module-service')
// implementation project(':modules:mogo-module-event-panel')
// implementation project(':modules:mogo-module-authorize')
}

View File

@@ -100,6 +100,7 @@ import java.util.Random;
import static com.mogo.module.common.utils.SPConst.getSPGuideRecord;
import static com.mogo.module.common.utils.SPConst.getSpGuide;
import static com.mogo.module.extensions.ExtensionsModuleConst.TYPE_ENTRANCE;
import static com.mogo.module.service.receiver.MogoReceiver.ACTION_V2X_REMOVE_TIP_WINDOW;
import static com.mogo.module.share.constant.ShareConstants.KEY_CLICK_SHARE_BUTTON;
import static com.mogo.module.share.constant.ShareConstants.KEY_CLICK_SHARE_TIME;
import static com.mogo.module.share.constant.ShareConstants.KEY_SERVER_SHOW_DAY_COUNT;
@@ -110,6 +111,7 @@ import static com.mogo.module.share.constant.ShareConstants.KEY_SHARE_OUTER_GUID
import static com.mogo.module.share.constant.ShareConstants.ONE_DAY_TIME;
import static com.mogo.module.share.constant.ShareConstants.SEVEN_DAY_TIME;
import static com.mogo.module.share.constant.ShareConstants.VOICE_ALERT_COUNT;
/**
* @author congtaowang
* @since 2020-01-07
@@ -285,7 +287,6 @@ public class EntranceFragment extends MvpFragment<EntranceView, EntrancePresente
mExitNavi = findViewById(R.id.module_entrance_id_exit_navi);
mCameraMode = findViewById(R.id.module_ext_id_north);
mApis.getIntentManagerApi().registerIntentListener(AUTONAVI_STANDARD_BROADCAST_RECV, this);
// mApis.getV2XListenerManager().registerIntentListener(MogoReceiver.ACTION_V2X_REMOVE_TIP_WINDOW, this);
MogoEntranceButtons.save(ButtonIndex.BUTTON1, findViewById(R.id.module_entrance_id_button1));
MogoEntranceButtons.save(ButtonIndex.BUTTON2, findViewById(R.id.module_entrance_id_button2));
mDisplayOverviewBounds = new Rect(
@@ -379,10 +380,6 @@ public class EntranceFragment extends MvpFragment<EntranceView, EntrancePresente
mSwitchMapModeImage = (ImageView) findViewById(R.id.module_switch_model_icon);
mSwitchMapModeLayout.setOnClickListener(clickListener);
mSwitchText = (TextView) findViewById(R.id.module_switch_model_text);
if (DebugConfig.getCarMachineType() == DebugConfig.CAR_MACHINE_TYPE_LENOVO) {
enterVrMode();
}
}
private int debugPanelClickCount = 0;
@@ -392,7 +389,6 @@ public class EntranceFragment extends MvpFragment<EntranceView, EntrancePresente
private Group groupFix;
private void enterVrMode() {
if (!localIsVrMode) {
tvEnterVrMode.setVisibility(View.GONE);
mMove2CurrentLocation.setVisibility(View.GONE);
mUploadRoadCondition.setVisibility(View.GONE);
@@ -410,25 +406,13 @@ public class EntranceFragment extends MvpFragment<EntranceView, EntrancePresente
MogoApisHandler.getInstance().getApis().getRegisterCenterApi()
.registerCarLocationChangedListener(TAG, this);
// MogoApisHandler.getInstance().getApis().getRegisterCenterApi().registerMogoLocationListener(TAG, this);
localIsVrMode = true;
flSpeed.setVisibility(View.VISIBLE);
mSwitchMapModeLayout.setVisibility(View.VISIBLE);
try {
//清除2D模式下道路事件弹框
// MarkerServiceHandler.getApis().getV2XListenerManager().changeTipWindowStatusForListener(MogoReceiver.ACTION_V2X_REMOVE_TIP_WINDOW);
} catch (Exception e) {
e.printStackTrace();
}
}
mApis.getV2XListenerManager().changeTipWindowStatusForListener(ACTION_V2X_REMOVE_TIP_WINDOW);
}
private void exitVrMode() {
if (localIsVrMode) {
EntranceViewHolder.getInstance().forceHideNoticeView();
tvEnterVrMode.setVisibility(View.VISIBLE);
mMove2CurrentLocation.setVisibility(View.VISIBLE);
@@ -452,7 +436,6 @@ public class EntranceFragment extends MvpFragment<EntranceView, EntrancePresente
flSpeed.setVisibility(View.GONE);
mSwitchMapModeLayout.setVisibility(View.GONE);
clTrafficLight.setVisibility(View.GONE);
}
}
private void debugCrashWarn() {
@@ -731,29 +714,21 @@ public class EntranceFragment extends MvpFragment<EntranceView, EntrancePresente
TopViewAnimHelper.getInstance().setIMogoMapUIController(mMApUIController);
TopViewNoLinkageAnimHelper.getInstance().setIMogoMapUIController(mMApUIController);
// 进入vr模式不可缩放地图
if (DebugConfig.getCarMachineType() == DebugConfig.CAR_MACHINE_TYPE_LENOVO) {
UiThreadHandler.postDelayed(this::stepIntoVrMode, 3_500L);
}
mClickShareVoiceStrings =
getContext().getResources().getStringArray(R.array.click_share_voice_guide_array);
mInnerGuideVoiceStrings =
getContext().getResources().getStringArray(R.array.search_voice_guide_inner_array);
mOuterGuideVoiceStrings =
getContext().getResources().getStringArray(R.array.search_voice_guide_outer_array);
}
/**
* 进入鹰眼模式,设置手势缩放地图失效
*/
private void stepIntoVrMode() {
Logger.d(TAG, "进入vr模式");
MogoApisHandler.getInstance()
.getApis()
.getMapServiceApi()
.getMapUIController()
.openVrMode(false);
//TODO 因为衡阳6.30交付没有2D模式临时方案进入vr模式不可缩放地图
if (DebugConfig.getCarMachineType() == DebugConfig.CAR_MACHINE_TYPE_LENOVO) {
// 进入鹰眼模式,设置手势缩放地图失效
Logger.d(TAG, "进入vr模式");
mMApUIController.changeMapMode(EnumMapUI.Type_VR);
MogoApisHandler.getInstance().getApis().getStatusManagerApi().setVrMode( TAG, true );
}
}
@Override
@@ -926,7 +901,6 @@ public class EntranceFragment extends MvpFragment<EntranceView, EntrancePresente
}
} else if (descriptor == StatusDescriptor.VR_MODE) {
try {
Log.d("liyz", "vr isTrue = " + isTrue);
if (isTrue) {
enterVrMode();
} else {
@@ -1114,32 +1088,6 @@ public class EntranceFragment extends MvpFragment<EntranceView, EntrancePresente
@Override
public void onMapModeChanged(EnumMapUI ui) {
Log.d("liyz", "fragment onMapModeChanged -----> ");
// if (DebugConfig.getCarMachineType() != DebugConfig.CAR_MACHINE_TYPE_LENOVO ) {
// if ( ui == EnumMapUI.Type_VR ) {
// Log.d("liyz", "onMapModeChanged mLastStatusIsVr = " + mLastStatusIsVr + "--ui = " +ui);
// if ( !mLastStatusIsVr ) {
// MogoApisHandler.getInstance().getApis().getStatusManagerApi().setVrMode( TAG, true );
// MapCenterPointStrategy.resetByChangeMode();
//// MapMarkerManager.getInstance().redrawMarkerByStyleChanged();
// if (DebugConfig.getCarMachineType() != DebugConfig.CAR_MACHINE_TYPE_LENOVO ) {
// AIAssist.getInstance( getContext() ).speakTTSVoice( "已开启鹰眼模式" );
// }
// mLastStatusIsVr = true;
// }
// } else {
// if ( mLastStatusIsVr ) {
// mLastStatusIsVr = false;
// MogoApisHandler.getInstance().getApis().getStatusManagerApi().setVrMode( TAG, false );
// MapCenterPointStrategy.resetByChangeMode();
//// MapMarkerManager.getInstance().redrawMarkerByStyleChanged();
// if (DebugConfig.getCarMachineType() != DebugConfig.CAR_MACHINE_TYPE_LENOVO ) {
// AIAssist.getInstance( getContext() ).speakTTSVoice( "已退出鹰眼模式" );
// }
// }
// }
// }
if (mCameraMode == null) {
return;
}
@@ -1368,7 +1316,6 @@ public class EntranceFragment extends MvpFragment<EntranceView, EntrancePresente
}
} else if (v.getId() == R.id.module_ext_enter_vr_mode) {
// 进入vr模式
Log.d("liyz", "enter --vr--");
mMApUIController.changeMapMode(EnumMapUI.Type_VR);
} else if (v.getId() == R.id.module_ext_exit_vr_mode) {
// 退出vr模式

View File

@@ -65,7 +65,7 @@
android:id="@+id/warning_bottom"
android:layout_width="match_parent"
android:layout_height="@dimen/dp_390"
android:layout_marginTop="@dimen/dp_690"
android:layout_gravity="bottom"
android:background="@drawable/module_main_warning_bkg_bottom"
android:visibility="gone" />

View File

@@ -437,7 +437,9 @@ public class MogoServices implements IMogoMapListener,
// isNeedUploadCoordinatesDurationInTime() ) { //todo 实时在线车辆需要注释否则在2D模式下不能展示
// }
//请求在线车辆数据,刷新地图在线车辆
MapMarkerManager.getInstance().getOnlineCarDataByAutoRefreshStrategy( ro.mLonLat );
if (!mLastStatusIsVr){
MapMarkerManager.getInstance().getOnlineCarDataByAutoRefreshStrategy( ro.mLonLat );
}
Logger.i( TAG, "刷新半径 = %s, 点 = %s, zoomLevel = %s, amount = %s", ro.mRadius, ro.mLonLat, mLastZoomLevel, ro.mAmount );
}
@@ -938,9 +940,9 @@ public class MogoServices implements IMogoMapListener,
@Override
public void onMapModeChanged( EnumMapUI ui ) {
Log.d("liyz", "onMapModeChanged ----> ui = " + ui);
Log.i(TAG, "onMapModeChanged:" + ui);
clearAllData();
if ( ui == EnumMapUI.Type_VR ) {
Log.d("liyz", "onMapModeChanged mLastStatusIsVr = " + mLastStatusIsVr + "--ui = " +ui);
if ( !mLastStatusIsVr ) {
MogoApisHandler.getInstance().getApis().getStatusManagerApi().setVrMode( TAG, true );
MapCenterPointStrategy.resetByChangeMode();

View File

@@ -8,7 +8,6 @@ import com.mogo.module.common.MogoApisHandler;
import com.mogo.module.service.launchercard.LauncherCardRefresher;
import com.mogo.module.service.marker.MapMarkerManager;
import com.mogo.module.service.strategy.CarIconDisplayStrategy;
import com.mogo.module.service.vrmode.VrModeController;
import com.mogo.service.statusmanager.IMogoStatusChangedListener;
import com.mogo.service.statusmanager.StatusDescriptor;
import com.mogo.utils.UiThreadHandler;
@@ -90,7 +89,6 @@ abstract class StatusChangedAdapter implements IMogoStatusChangedListener {
MogoServices.getInstance().unregisterInternalUnWakeupWords();
MogoServices.getInstance().stopAutoRefreshStrategy();
}
VrModeController.getInstance().onMainPageResumeStatusChanged(resume);
}
public void onMainPageIsBackgroundStatusChanged(boolean isBackground) {
@@ -163,7 +161,6 @@ abstract class StatusChangedAdapter implements IMogoStatusChangedListener {
}
public void onVrModeChanged(boolean isVrMode) {
VrModeController.getInstance().onVrModeChanged(isVrMode);
if (MarkerServiceHandler.getMogoStatusManager().isSeekHelping()) {
onSeekHelpingStatusChanged(true);
}

View File

@@ -77,9 +77,11 @@ public class MockIntentHandler implements IntentHandler {
final int oper = intent.getIntExtra("oper", -1);
switch (oper) {
case 1:
// 展示自车位置
MarkerServiceHandler.getMapUIController().showMyLocation(intent.getBooleanExtra("status", true));
break;
case 2:
// 发起求助
boolean status = intent.getBooleanExtra("status", false);
MarkerServiceHandler.getMogoStatusManager().setSeekHelping(TAG, status);
break;
@@ -403,7 +405,6 @@ public class MockIntentHandler implements IntentHandler {
.syncLocation2Map(null);
break;
case 40:
double[][] coors = new double[][]{{40.17511749267578, 116.74359130859375},
{40.20258331298828, 116.74071502685547},
{40.202598571777344, 116.74067687988281},
@@ -444,7 +445,6 @@ public class MockIntentHandler implements IntentHandler {
{40.20254135131836, 116.74005889892578},
{40.20252990722656, 116.74007415771484},
{40.20254898071289, 116.74008178710938},
{40.20254135131836, 116.74005889892578},
{40.20252227783203, 116.74006652832031},
{40.20254898071289, 116.74002838134766},
@@ -542,12 +542,8 @@ public class MockIntentHandler implements IntentHandler {
.getMapUIController()
.openVrMode(false);
break;
case 46:// 模拟 自车周边数据
// String json = "{\"allList\":[{\"type\":3,\"uuid\":\"10009-5152\",\"lat\":40.1990809296,\"lon\":116.7393252195,\"speed\":0.0,\"heading\":0.0,\"systemTime\":1614329151909,\"vehicleType\":0,\"distance\":576.0,\"fromType\":3,\"isOnline\":0},{\"type\":3,\"uuid\":\"10009-5161\",\"lat\":40.1990827227,\"lon\":116.739325826,\"speed\":0.0,\"heading\":0.0,\"systemTime\":1614329151909,\"vehicleType\":0,\"distance\":576.0,\"fromType\":3,\"isOnline\":0}],\"nearList\":[],\"time\":1614329152238}";
// SnapshotSetDataDrawer.getInstance().renderSnapshotData(GsonUtil.objectFromJson(json, MogoSnapshotSetData.class)); //todo 需要重新模拟一个test数据
break;
case 47:// 模拟鹰眼模式下绘制车辆周边的数据
mTimeTickHandler.sendEmptyMessageDelayed(1, 0L);
case 46:// 模拟鹰眼模式下绘制车辆周边数据
// mTimeTickHandler.sendEmptyMessageDelayed(1, 0L);
break;
case 48:// 模拟3D模型绘制
MogoMarkerOptions options = new MogoMarkerOptions()
@@ -603,8 +599,8 @@ public class MockIntentHandler implements IntentHandler {
DebugConfig.setSelfCarSpeedYOffset(intent.getIntExtra("yOffset", 20));
break;
case 51:// 模拟路口车辆移动
mLocationMockHandler.sendEmptyMessageDelayed(100, 0L);
mLocationMockHandler.sendEmptyMessageDelayed(101, 1000L);
// mLocationMockHandler.sendEmptyMessageDelayed(100, 0L);
// mLocationMockHandler.sendEmptyMessageDelayed(101, 1000L);
break;
case 52:
// 打开连调工控机、ADAS的控制面板
@@ -616,7 +612,7 @@ public class MockIntentHandler implements IntentHandler {
DebugConfig.setUseAdasRecognize(isUseAdasRecognize);
break;
case 54:
mTimeTickCarHandler.sendEmptyMessageDelayed(1, 0L);
// mTimeTickCarHandler.sendEmptyMessageDelayed(1, 0L);
break;
case 55:
//开启模拟数据Mock用于验证算法准确性

View File

@@ -148,7 +148,7 @@ public class MapMarkerManager implements IMogoMarkerClickListener,
@Override
public void onMsgReceived(SocketDownData.LauncherSnapshotProto mogoSnapshotSetData) {
DebugConfig.setStatus(DebugConfig.sDownloadSnapshot, true);
// SnapshotSetDataDrawer.getInstance().renderSnapshotData(mogoSnapshotSetData); //todo 6月4号 提测版本中去掉云端下发数据展示
SnapshotSetDataDrawer.getInstance().renderSnapshotData(mogoSnapshotSetData);
// Message msg = mSnapshotHandler.obtainMessage();
// msg.obj = mogoSnapshotSetData;
// msg.what = MSG_SNAPSHOT;

View File

@@ -236,6 +236,7 @@ public class CarIconDisplayStrategy {
.icons(mBitmapFrames)
.period(20)
.zIndex(0)
.scale(MarkerServiceHandler.getMogoStatusManager().isVrMode() ? 0.4f : 1.0f)
.autoManager(false)
.anchor(0.5f, 0.5f)
.position(MarkerServiceHandler.getMapService().getNavi(AbsMogoApplication.getApp()).getCarLocation2()));

View File

@@ -146,6 +146,7 @@ public class TimeDelayUploadManager implements IMogoOnMessageListener<MockSocket
@Override
public void onMsgReceived(SocketDownData.LauncherSnapshotProto mogoSnapshotSetData) {
if (isMockData) {
Logger.d(TAG,"收到下发数据 mogoSnapshotSetData : " + mogoSnapshotSetData.toString());
//接口数据上报
SocketDownData.CloudRoadDataProto result = mogoSnapshotSetData.getAllListList()
.stream()
@@ -156,6 +157,7 @@ public class TimeDelayUploadManager implements IMogoOnMessageListener<MockSocket
Logger.d(TAG, "未找到与之匹配数据");
return;
}
Logger.d(TAG,"找到匹配数据 result : " + result.toString());
long satelliteTime;
if (TextUtils.isEmpty(adasControllerApi.getSatelliteTime())) {
satelliteTime = System.currentTimeMillis();

View File

@@ -2,8 +2,8 @@ package com.mogo.module.small.map;
import android.content.Context;
import android.graphics.BitmapFactory;
import android.location.Location;
import android.util.AttributeSet;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.widget.RelativeLayout;
@@ -14,15 +14,18 @@ import com.amap.api.maps.AMap;
import com.amap.api.maps.CameraUpdate;
import com.amap.api.maps.CameraUpdateFactory;
import com.amap.api.maps.UiSettings;
import com.amap.api.maps.model.CustomMapStyleOptions;
import com.amap.api.navi.AMapNavi;
import com.amap.api.navi.AMapNaviView;
import com.amap.api.navi.AMapNaviViewOptions;
import com.mogo.commons.AbsMogoApplication;
import com.mogo.commons.debug.DebugConfig;
import com.mogo.map.MogoLatLng;
import com.mogo.map.navi.IMogoCarLocationChangedListener2;
import com.mogo.module.common.MogoApisHandler;
import com.mogo.module.common.view.RoundLayout;
import com.mogo.utils.FileUtils;
import java.io.IOException;
import com.mogo.module.small.map.utils.MapAssetStyleUtils;
import com.mogo.utils.logger.Logger;
/**
* 小地图的方向View
@@ -30,13 +33,17 @@ import java.io.IOException;
* @author donghongyu
* @date 12/14/20 4:40 PM
*/
public class SmallMapDirectionView extends RelativeLayout {
private String styleFilePath = "/mnt/sdcard/amap/small_map_style.data";
public class SmallMapDirectionView extends RelativeLayout implements IMogoCarLocationChangedListener2 {
/**
* 小地图名称
*/
public static final String MODULE_NAME = "SmallMap";
private RoundLayout rlSmallMapBorder;
private AMapNaviView mAMapNaviView;
private AMap mAMap;
private AMapNavi mAMapNavi;
private int zoomLevel = 15;
private boolean mapIsLoaded = false;
public SmallMapDirectionView(Context context) {
this(context, null);
@@ -62,15 +69,63 @@ public class SmallMapDirectionView extends RelativeLayout {
rlSmallMapBorder = findViewById(R.id.rlSmallMapBorder);
rlSmallMapBorder.addView(mAMapNaviView);
initAMapView();
// 注册定位监听
SmpServiceManager.getMogoRegisterCenter()
.registerCarLocationChangedListener(MODULE_NAME, this);
setOnClickListener(view -> {
if (DebugConfig.getCarMachineType() != DebugConfig.CAR_MACHINE_TYPE_LENOVO) {
MogoApisHandler.getInstance().getApis()
.getMapServiceApi()
.getMapUIController()
.changeMapMode(
MogoApisHandler.getInstance()
.getApis()
.getAdasControllerApi()
.getCurrentSkinMode()
);
}
});
}
private void initAMapView() {
// 车头朝上
mAMapNaviView.setNaviMode(AMapNaviView.CAR_UP_MODE);
// 设置电子眼所在路线的可见性
mAMapNaviView.setRouteOverlayVisible(false);
AMap aMap = mAMapNaviView.getMap();
mAMap = mAMapNaviView.getMap();
// 关闭地图文字标注
aMap.showMapText(false);
mAMap.showMapText(false);
// 设置导航地图模式aMap是地图控制器对象。
mAMap.setMapType(AMap.MAP_TYPE_NIGHT);
// 关闭显示实时路况图层aMap是地图控制器对象。
mAMap.setTrafficEnabled(false);
mAMapNavi = AMapNavi.getInstance(getContext());
mAMapNavi.setIsUseExtraGPSData(false);
new Thread(() -> {
try {
Thread.sleep(1000L);
} catch (InterruptedException e) {
e.printStackTrace();
}
mAMap.setCustomMapStyle(
new CustomMapStyleOptions()
.setEnable(true)
.setStyleData(MapAssetStyleUtils.getAssetsStyle(getContext()))
.setStyleExtraData(MapAssetStyleUtils.getAssetsExtraStyle(getContext()))
);
//设置希望展示的地图缩放级别
CameraUpdate cameraUpdate = CameraUpdateFactory.zoomTo(zoomLevel);
mAMap.moveCamera(cameraUpdate);
}).start();
// 设置地图的样式
UiSettings uiSettings = aMap.getUiSettings();
UiSettings uiSettings = mAMap.getUiSettings();
uiSettings.setZoomControlsEnabled(false);// 地图缩放级别的交换按钮
uiSettings.setAllGesturesEnabled(false);// 所有手势
uiSettings.setMyLocationButtonEnabled(false); // 显示默认的定位按钮
@@ -137,95 +192,9 @@ public class SmallMapDirectionView extends RelativeLayout {
// 2D模式
options.setTilt(0);
// 黑夜模式
//options.setNaviNight(true);
// 自定义地图样式
options.setCustomMapStylePath(styleFilePath);
options.setNaviNight(true);
mAMapNaviView.setViewOptions(options);
}
//设置希望展示的地图缩放级别
CameraUpdate cameraUpdate = CameraUpdateFactory.zoomTo(zoomLevel);
aMap.moveCamera(cameraUpdate);
try {
// 判断是否有样式文件存在
FileUtils.copy(
context.getAssets().open("small_map_style.data"),
styleFilePath,
new FileUtils.FileCopyListener() {
@Override
public void onStart() {
Log.w("FileCopyListener", "onStart=");
}
@Override
public void onFail(Exception e) {
Log.w("FileCopyListener", "onFail=");
e.printStackTrace();
}
@Override
public void onProcess(int process) {
Log.w("FileCopyListener", "onProcess=" + process);
}
@Override
public void onFinish(String toPath) {
Log.w("FileCopyListener", "onFinish toPath=" + toPath);
// 高德地图有bug所以需要多次调用设置皮肤才能成功
if (options != null) {
options.setCustomMapStylePath(styleFilePath);
mAMapNaviView.setViewOptions(options);
}
//设置希望展示的地图缩放级别
CameraUpdate cameraUpdate = CameraUpdateFactory.zoomTo(zoomLevel);
aMap.moveCamera(cameraUpdate);
}
}
);
} catch (IOException e) {
e.printStackTrace();
}
new Thread(new Runnable() {
@Override
public void run() {
try {
Thread.sleep(1000L);
} catch (InterruptedException e) {
e.printStackTrace();
}
// 高德地图有bug所以需要多次调用设置皮肤才能成功
if (options != null) {
options.setCustomMapStylePath(styleFilePath);
mAMapNaviView.setViewOptions(options);
}
//设置希望展示的地图缩放级别
CameraUpdate cameraUpdate = CameraUpdateFactory.zoomTo(zoomLevel);
aMap.moveCamera(cameraUpdate);
}
}).start();
setOnClickListener(view -> {
if (DebugConfig.getCarMachineType() != DebugConfig.CAR_MACHINE_TYPE_LENOVO) {
MogoApisHandler.getInstance().getApis()
.getMapServiceApi()
.getMapUIController()
.changeMapMode(
MogoApisHandler.getInstance()
.getApis()
.getAdasControllerApi()
.getCurrentSkinMode()
);
}
});
}
@@ -233,4 +202,17 @@ public class SmallMapDirectionView extends RelativeLayout {
public boolean onInterceptTouchEvent(MotionEvent ev) {
return true;
}
@Override
public void onCarLocationChanged2(Location latLng) {
Logger.d(MODULE_NAME, "onCarLocationChanged2 latLng:" + latLng);
if (mAMapNavi != null) {
mAMapNavi.setExtraGPSData(2, latLng);
}
}
@Override
public void onCarLocationChanged(MogoLatLng latLng) {
Logger.d(MODULE_NAME, "onCarLocationChanged latLng:" + latLng);
}
}

View File

@@ -0,0 +1,45 @@
package com.mogo.module.small.map;
import android.content.Context;
import com.alibaba.android.arouter.launcher.ARouter;
import com.mogo.service.IMogoServiceApis;
import com.mogo.service.MogoServicePaths;
import com.mogo.service.module.IMogoRegisterCenter;
/**
* author : donghongyu
* e-mail : 1358506549@qq.com
* date : 2020-01-2114:01
* desc : V2X 服务
* version: 1.0
*/
public class SmpServiceManager {
private static final String TAG = "V2XServiceManager";
private static boolean isInit;
private static Context mContext;
private static IMogoServiceApis mMogoServiceApis;
private static IMogoRegisterCenter mMogoRegisterCenter;
private SmpServiceManager() {
}
public static void init(final Context context) {
if (!isInit) {
isInit = true;
mContext = context;
mMogoServiceApis = (IMogoServiceApis) ARouter.getInstance().build(MogoServicePaths.PATH_SERVICE_APIS).navigation(context);
mMogoRegisterCenter = mMogoServiceApis.getRegisterCenterApi();
}
}
public static Context getContext() {
return mContext;
}
public static IMogoRegisterCenter getMogoRegisterCenter() {
return mMogoRegisterCenter;
}
}

View File

@@ -94,6 +94,9 @@ dependencies {
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
implementation project(':modules:mogo-module-obu')
// implementation rootProject.ext.dependencies.mebulaobu
implementation rootProject.ext.dependencies.mogoobu
}
apply from: new File(rootProject.rootDir, "gradle/upload.gradle").toString()

View File

@@ -8,23 +8,29 @@ import android.os.Handler;
import android.os.Message;
import android.os.SystemClock;
import android.util.ArrayMap;
import android.util.Log;
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
import com.mogo.cloud.commons.utils.CoordinateUtils;
import com.mogo.commons.debug.DebugConfig;
import com.mogo.commons.voice.AIAssist;
import com.mogo.map.location.MogoLocation;
import com.mogo.module.common.MogoApisHandler;
import com.mogo.module.common.entity.V2XMessageEntity;
import com.mogo.module.common.entity.V2XObuEventEntity;
import com.mogo.module.common.entity.V2XPushMessageEntity;
import com.mogo.module.service.MarkerServiceHandler;
import com.mogo.module.service.receiver.MogoReceiver;
import com.mogo.module.v2x.listener.V2XLocationListener;
import com.mogo.module.v2x.scenario.scene.obu.V2XObuEventScenario;
import com.mogo.module.v2x.utils.ADASUtils;
import com.mogo.module.v2x.utils.DrivingDirectionUtils;
import com.mogo.module.v2x.utils.ObuConfig;
import com.mogo.module.v2x.utils.TestOnLineCarUtils;
import com.mogo.module.v2x.utils.ToastUtils;
import com.mogo.service.entrance.IMogoEntranceButtonController;
import com.mogo.utils.UiThreadHandler;
import com.mogo.utils.logger.Logger;
import com.zhidao.mogo.module.obu.ObuConstant;
import com.zhidao.mogo.module.obu.ObuManager;
@@ -32,10 +38,25 @@ import com.zhidao.mogo.module.obu.obu.IObuCallback;
import com.zhidao.mogo.module.obu.obu.bean.MogoObuEventInfo;
import com.zhidao.mogo.module.obu.obu.bean.MogoObuLocationInfo;
import com.zhidao.mogo.module.obu.obu.bean.MogoObuTrafficLightInfo;
//import com.zhidao.support.nebulaobu.NebulaObuClient;
//import com.zhidao.support.nebulaobu.OnObuListener;
//import com.zhidao.support.nebulaobu.model.ActiveSafetyInfo;
//import com.zhidao.support.nebulaobu.model.ObuInfo;
//import com.zhidao.support.nebulaobu.model.ObuInfoMore;
import com.zhidao.support.obu.MogoObuManager;
import com.zhidao.support.obu.OnMogoObuListener;
import com.zhidao.support.obu.model.CvxAppInitIndInfo;
import com.zhidao.support.obu.model.CvxHvCarIndInfo;
import com.zhidao.support.obu.model.CvxHvInfoIndInfo;
import com.zhidao.support.obu.model.CvxRvInfoIndInfo;
import com.zhidao.support.obu.model.CvxSetConfigCfmInfo;
import com.zhidao.support.obu.model.CvxV2vThreatIndInfo;
import org.json.JSONArray;
import org.json.JSONObject;
import java.util.List;
import java.util.Map;
import static com.mogo.module.v2x.V2XConst.MODULE_NAME;
@@ -76,14 +97,174 @@ public class V2XObuManager implements IObuCallback, Handler.Callback {
public void init(Context context) {
Logger.d(MODULE_NAME, "obuManager初始化--");
//之前内部对接的obu
obuManager = new ObuManager();
obuManager.init(context);
obuManager.registerObuDataChangedListener(this);
//使用adas部门obu sdk (星云)
// NebulaObuClient.getInstance().init(context);
// NebulaObuClient.getInstance().registerObu(100);
// NebulaObuClient.getInstance().registerObuListener(listener);
//自研obu
MogoObuManager.getInstance().init(context);
MogoObuManager.getInstance().connect();
MogoObuManager.getInstance().registerListener(mogoObuListener);
MogoObuManager.getInstance().unregisterListener();
// UiThreadHandler.postDelayed( () -> {
// //TODO 测试
// MarkerServiceHandler.getApis().getV2XListenerManager().warningChangedForListenerWithDirection(3, MogoReceiver.ACTION_V2X_FRONT_WARNING);
// handleSdkObu(1);
//
// }, 5_000L );
IntentFilter filter = new IntentFilter("com.mogo.launcher.v2x.action.EXCHANGE_OBU_TYPE");
context.registerReceiver(obuTypeExchangeReceiver, filter);
}
private OnMogoObuListener mogoObuListener = new OnMogoObuListener() {
@Override
public void onConnected() {
//OBU连接成功
Logger.d("liyz", "onConnected ------> ");
}
@Override
public void onConnectFail(boolean isNeedReconnect) {
Logger.d("liyz", "onConnectFail ------> ");
//OBU连接失败
}
@Override
public void onDisconnect() {
Logger.d("liyz", "onDisconnect ------> ");
//OBU断开连接
}
@Override
public void onReceiveOriginData(String data) {
super.onReceiveOriginData(data);
Logger.d("liyz", "onReceiveOriginData ------> data = " + data);
//接收到的原始数据
}
@Override
public void onSendData(byte[] bytes) {
super.onSendData(bytes);
//发送的数据
Logger.d("liyz", "onSendData ------> ");
}
@Override
public void onCvxAppInitIndInfo(CvxAppInitIndInfo info) {
super.onCvxAppInitIndInfo(info);
Logger.d("liyz", "onCvxAppInitIndInfo ------> " + info.toString());
//CV2X系统信息
}
@Override
public void onCvxSetConfigCfm(CvxSetConfigCfmInfo info) {
super.onCvxSetConfigCfm(info);
Logger.d("liyz", "onCvxSetConfigCfm ------> " + info.toString());
//设置CV2X系统的配置确认
}
@Override
public void onCvxHvCarIndInfo(CvxHvCarIndInfo info) {
//主车车辆信息
Logger.d("liyz", "onCvxHvCarIndInfo ------> " + info.toString());
}
@Override
public void onCvxHvInfoIndInfo(CvxHvInfoIndInfo info) {
//主车信息
}
@Override
public void onCvxRvInfoIndInfo(CvxRvInfoIndInfo info) {
//远车信息
Logger.d("liyz", "onCvxRvInfoIndInfo ------> " + info.toString());
}
@Override
public void onCvxV2vThreatIndInfo(CvxV2vThreatIndInfo info) {
//预警信息
Logger.e("liyz", "onCvxRvInfoIndInfo ------> " + info.toString());
//预警数据的组装,车辆实时移动和变色。
//预警方位
//预警类型
}
};
// public void release() {
// NebulaObuClient.getInstance().unregisterObu();
// NebulaObuClient.getInstance().unregisterObuListener();
// }
/**
* 星云obu数据监听
*/
// private OnObuListener listener = new OnObuListener() {
// @Override
// public void onRegister() {
// }
//
// @Override
// public void onConnectFail(boolean isNeedReconnect) {
// Logger.d("liyz", "onConnectFail ------> ");
// }
//
// @Override
// public void onUnregister() {
// }
//
// @Override
// public void onObuInfo(ObuInfo info) {
// Logger.d("liyz", "onObuInfo ------> " + info.toString());
// }
//
// @Override
// public void onWarningInfo(List<ActiveSafetyInfo> infoList) {
// if (infoList != null) {
// if (infoList.size() > 0) { //一般只有一个
// ActiveSafetyInfo info = infoList.get(0);
// Logger.d("liyz", "onWarningInfo type ------> " + info.getWarningtype() + "--size = " + infoList.size());
// if (info.getWarningtype() == 3) {
// if (MogoApisHandler.getInstance().getApis().getStatusManagerApi().isVrMode()) {
// handleSdkObu(2);
// }
// }
// }
// }
// }
// };
private void handleSdkObu(int type) {
V2XMessageEntity<V2XObuEventEntity> messageEntity = new V2XMessageEntity<>();
messageEntity.setType(V2XMessageEntity.V2XTypeEnum.ALERT_OBU_EVENT);
V2XObuEventEntity urgencyEvent = new V2XObuEventEntity();
if (type == 1) { //交叉路口碰撞预警 TODO
urgencyEvent.setType(ObuConstant.TYPE_CROSS_COLLISION_WARNING);
urgencyEvent.setDesc(V2XObuEventScenario.URGENCY_CROING_WARN_TEXT);
} else if (type == 2) { // 前车紧急制动预警
urgencyEvent.setType(ObuConstant.TYPE_URGENCY_COLLISION_WARNING);
urgencyEvent.setDesc(V2XObuEventScenario.URGENCY_COLLISION_WARN_TEXT);
} else {
urgencyEvent.setType(ObuConstant.TYPE_URGENCY_COLLISION_WARNING);
urgencyEvent.setDesc(V2XObuEventScenario.URGENCY_COLLISION_WARN_TEXT);
}
messageEntity.setContent(urgencyEvent);
V2XObuEventScenario.getInstance().init(messageEntity);
}
/**
* 用来处理30秒内不重复播报的情况
*/

View File

@@ -199,14 +199,14 @@ public class V2XOtherSeekHelpVH extends V2XBaseViewHolder<V2XEventShowEntity> {
if (mV2XPushMessageEntity.getDistance() > 1000) {
SpanUtils.with(tvDistance)
.append("" + (int) mV2XPushMessageEntity.getDistance() / 1000)
.setFontSize((int) itemView.getResources().getDimension(V2XServiceManager.getMoGoStatusManager().isVrMode() ? R.dimen.dp_42 : R.dimen.module_v2x_event_distance_text))
.setFontSize((int) itemView.getResources().getDimension(V2XServiceManager.getMoGoStatusManager().isVrMode() ? R.dimen.module_v2x_fault_help_distance_text_size : R.dimen.module_v2x_event_distance_text))
.append("公里")
.setFontSize((int) itemView.getResources().getDimension(V2XServiceManager.getMoGoStatusManager().isVrMode() ? R.dimen.dp_42 : R.dimen.module_v2x_event_distance_title))
.create();
} else {
SpanUtils.with(tvDistance)
.append("" + (int) mV2XPushMessageEntity.getDistance())
.setFontSize((int) itemView.getResources().getDimension(V2XServiceManager.getMoGoStatusManager().isVrMode() ? R.dimen.dp_42 : R.dimen.module_v2x_event_distance_text))
.setFontSize((int) itemView.getResources().getDimension(V2XServiceManager.getMoGoStatusManager().isVrMode() ? R.dimen.module_v2x_fault_help_distance_text_size : R.dimen.module_v2x_event_distance_text))
.append("")
.setFontSize((int) itemView.getResources().getDimension(
V2XServiceManager.getMoGoStatusManager().isVrMode() ?

View File

@@ -2,6 +2,7 @@ package com.mogo.module.v2x.manager.impl;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import com.alibaba.android.arouter.facade.annotation.Route;
import com.mogo.commons.AbsMogoApplication;
@@ -39,10 +40,12 @@ import com.mogo.module.v2x.utils.MarkerUtils;
import com.mogo.utils.ViewUtils;
import com.mogo.utils.logger.Logger;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.concurrent.CopyOnWriteArraySet;
import static com.mogo.module.service.strategy.CarIconDisplayStrategy.sFrameVr;
import static com.mogo.module.v2x.V2XConst.MODULE_NAME;
import static com.mogo.module.v2x.V2XConst.V2X_EVENT_ALARM_POI;
@@ -61,6 +64,7 @@ public class MoGoV2XMarkerManager implements IMoGoV2XMarkerManager {
private static CopyOnWriteArraySet<V2XRoadEventEntity> mV2XRoadEventEntityArrayList = new CopyOnWriteArraySet<>();
// 上次的道路事件的预警Marker
private static IMogoMarker mAlarmInfoMarker;
private static IMogoMarker m3DMarker;
@Override
public void drawableLastAllPOI() {
@@ -270,13 +274,35 @@ public class MoGoV2XMarkerManager implements IMoGoV2XMarkerManager {
} else {
mAlarmInfoMarker = V2XServiceManager.getMarkerManager().addMarker(V2X_EVENT_ALARM_POI, optionsRipple);
}
// 当前Marker设置为最上面
mAlarmInfoMarker.setToTop();
} else {
optionsRipple.icons(V2XMarkerAdapter.getV2XRoadEventViewGif(context, roadEventEntity));
optionsRipple.period(100);
mAlarmInfoMarker = V2XServiceManager.getMarkerManager().addMarker(V2X_EVENT_ALARM_POI, optionsRipple);
if (V2XServiceManager.getMoGoStatusManager().isVrMode()) {
ArrayList<Bitmap> mBitmapFrames = new ArrayList<>();
for (int i : sFrameVr) {
mBitmapFrames.add(BitmapFactory.decodeResource(AbsMogoApplication.getApp().getResources(), i));
}
optionsRipple.icons(mBitmapFrames);
optionsRipple.period(20);
optionsRipple.scale(0.4f);
mAlarmInfoMarker = V2XServiceManager.getMarkerManager().addMarker(V2X_EVENT_ALARM_POI, optionsRipple);
MogoMarkerOptions options = new MogoMarkerOptions().object(roadEventEntity)
.latitude(roadEventEntity.getLocation().getLat()).longitude(roadEventEntity.getLocation().getLon());
options.anchor(0.5f, 0.5f);
options.icon3DRes(com.mogo.module.common.R.raw.othercar);
options.anchorColor("#FFBF29FF");
m3DMarker = V2XServiceManager.getMarkerManager().addMarker(V2X_EVENT_ALARM_POI, options);
m3DMarker.setToTop();
} else {
optionsRipple.icons(V2XMarkerAdapter.getV2XRoadEventViewGif(context, roadEventEntity));
optionsRipple.period(100);
mAlarmInfoMarker = V2XServiceManager.getMarkerManager().addMarker(V2X_EVENT_ALARM_POI, optionsRipple);
// 当前Marker设置为最上面
mAlarmInfoMarker.setToTop();
}
}
// 当前Marker设置为最上面
mAlarmInfoMarker.setToTop();
// 绘制连接线
V2XServiceManager.getMoGoV2XPolylineManager().drawablePolyline(context, roadEventEntity);
// 缩放地图
@@ -302,6 +328,9 @@ public class MoGoV2XMarkerManager implements IMoGoV2XMarkerManager {
if (mAlarmInfoMarker != null) {
mAlarmInfoMarker.remove();
}
if (m3DMarker != null) {
m3DMarker.remove();
}
}
}

View File

@@ -8,6 +8,7 @@ import com.mogo.module.common.entity.V2XPoiTypeEnum;
import com.mogo.module.common.entity.V2XPushMessageEntity;
import com.mogo.module.common.entity.V2XRoadEventEntity;
import com.mogo.module.v2x.R;
import com.mogo.module.v2x.V2XServiceManager;
import com.mogo.module.v2x.utils.ImageUtil;
import com.mogo.module.v2x.utils.V2XUtils;
@@ -131,44 +132,44 @@ public class V2XMarkerAdapter {
*/
public static ArrayList<Bitmap> getV2XRoadEventOrangeMarkerView(Context context, V2XRoadEventEntity alarmInfo) {
ArrayList<Bitmap> icons = new ArrayList<>();
icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, R.drawable.v_to_x_warning_circle_orange_00011));
icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, R.drawable.v_to_x_warning_circle_orange_00012));
icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, R.drawable.v_to_x_warning_circle_orange_00013));
icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, R.drawable.v_to_x_warning_circle_orange_00014));
icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, R.drawable.v_to_x_warning_circle_orange_00015));
icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, R.drawable.v_to_x_warning_circle_orange_00016));
icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, R.drawable.v_to_x_warning_circle_orange_00017));
icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, R.drawable.v_to_x_warning_circle_orange_00018));
icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, R.drawable.v_to_x_warning_circle_orange_00019));
icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, R.drawable.v_to_x_warning_circle_orange_00020));
icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, R.drawable.v_to_x_warning_circle_orange_00021));
icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, R.drawable.v_to_x_warning_circle_orange_00022));
icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, R.drawable.v_to_x_warning_circle_orange_00023));
icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, R.drawable.v_to_x_warning_circle_orange_00024));
icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, R.drawable.v_to_x_warning_circle_orange_00025));
icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, R.drawable.v_to_x_warning_circle_orange_00026));
icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, R.drawable.v_to_x_warning_circle_orange_00027));
icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, R.drawable.v_to_x_warning_circle_orange_00028));
icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, R.drawable.v_to_x_warning_circle_orange_00029));
icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, R.drawable.v_to_x_warning_circle_orange_00030));
icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, R.drawable.v_to_x_warning_circle_orange_00031));
icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, R.drawable.v_to_x_warning_circle_orange_00032));
icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, R.drawable.v_to_x_warning_circle_orange_00033));
icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, R.drawable.v_to_x_warning_circle_orange_00034));
icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, R.drawable.v_to_x_warning_circle_orange_00035));
icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, R.drawable.v_to_x_warning_circle_orange_00036));
icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, R.drawable.v_to_x_warning_circle_orange_00037));
icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, R.drawable.v_to_x_warning_circle_orange_00038));
icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, R.drawable.v_to_x_warning_circle_orange_00039));
icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, R.drawable.v_to_x_warning_circle_orange_00040));
icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, R.drawable.v_to_x_warning_circle_orange_00041));
icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, R.drawable.v_to_x_warning_circle_orange_00042));
icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, R.drawable.v_to_x_warning_circle_orange_00043));
icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, R.drawable.v_to_x_warning_circle_orange_00044));
icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, R.drawable.v_to_x_warning_circle_orange_00045));
icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, R.drawable.v_to_x_warning_circle_orange_00046));
icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, R.drawable.v_to_x_warning_circle_orange_00047));
icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, R.drawable.v_to_x_warning_circle_orange_00048));
icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, R.drawable.v_to_x_warning_circle_orange_00011));
icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, R.drawable.v_to_x_warning_circle_orange_00012));
icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, R.drawable.v_to_x_warning_circle_orange_00013));
icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, R.drawable.v_to_x_warning_circle_orange_00014));
icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, R.drawable.v_to_x_warning_circle_orange_00015));
icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, R.drawable.v_to_x_warning_circle_orange_00016));
icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, R.drawable.v_to_x_warning_circle_orange_00017));
icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, R.drawable.v_to_x_warning_circle_orange_00018));
icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, R.drawable.v_to_x_warning_circle_orange_00019));
icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, R.drawable.v_to_x_warning_circle_orange_00020));
icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, R.drawable.v_to_x_warning_circle_orange_00021));
icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, R.drawable.v_to_x_warning_circle_orange_00022));
icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, R.drawable.v_to_x_warning_circle_orange_00023));
icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, R.drawable.v_to_x_warning_circle_orange_00024));
icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, R.drawable.v_to_x_warning_circle_orange_00025));
icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, R.drawable.v_to_x_warning_circle_orange_00026));
icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, R.drawable.v_to_x_warning_circle_orange_00027));
icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, R.drawable.v_to_x_warning_circle_orange_00028));
icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, R.drawable.v_to_x_warning_circle_orange_00029));
icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, R.drawable.v_to_x_warning_circle_orange_00030));
icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, R.drawable.v_to_x_warning_circle_orange_00031));
icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, R.drawable.v_to_x_warning_circle_orange_00032));
icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, R.drawable.v_to_x_warning_circle_orange_00033));
icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, R.drawable.v_to_x_warning_circle_orange_00034));
icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, R.drawable.v_to_x_warning_circle_orange_00035));
icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, R.drawable.v_to_x_warning_circle_orange_00036));
icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, R.drawable.v_to_x_warning_circle_orange_00037));
icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, R.drawable.v_to_x_warning_circle_orange_00038));
icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, R.drawable.v_to_x_warning_circle_orange_00039));
icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, R.drawable.v_to_x_warning_circle_orange_00040));
icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, R.drawable.v_to_x_warning_circle_orange_00041));
icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, R.drawable.v_to_x_warning_circle_orange_00042));
icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, R.drawable.v_to_x_warning_circle_orange_00043));
icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, R.drawable.v_to_x_warning_circle_orange_00044));
icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, R.drawable.v_to_x_warning_circle_orange_00045));
icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, R.drawable.v_to_x_warning_circle_orange_00046));
icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, R.drawable.v_to_x_warning_circle_orange_00047));
icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, R.drawable.v_to_x_warning_circle_orange_00048));
return icons;
}

View File

@@ -10,6 +10,7 @@ import com.mogo.module.common.entity.MarkerExploreWay
import com.mogo.module.common.entity.V2XPoiTypeEnum
import com.mogo.module.common.entity.V2XRoadEventEntity
import com.mogo.module.v2x.R
import com.mogo.module.v2x.V2XServiceManager
import com.mogo.utils.ViewUtils
import kotlinx.android.synthetic.main.view_marker_event_car.view.*

View File

@@ -1,13 +1,16 @@
package com.mogo.module.v2x.scenario.impl;
import android.text.TextUtils;
import android.util.Log;
import androidx.annotation.Nullable;
import com.mogo.commons.voice.AIAssist;
import com.mogo.commons.voice.IMogoVoiceCmdCallBack;
import com.mogo.commons.voice.VoicePreemptType;
import com.mogo.module.common.MogoApisHandler;
import com.mogo.module.common.entity.V2XMessageEntity;
import com.mogo.module.service.receiver.MogoReceiver;
import com.mogo.module.v2x.V2XConst;
import com.mogo.module.v2x.scenario.IV2XScenario;
import com.mogo.module.v2x.scenario.view.IV2XButton;
@@ -24,7 +27,7 @@ import com.mogo.utils.logger.Logger;
* desc :
* version: 1.0
*/
public abstract class AbsV2XScenario<T> implements IV2XScenario, IV2XWindowManagerListener {
public abstract class AbsV2XScenario<T> implements IV2XScenario {
protected String TAG = "AbsV2XScenario";
private IV2XWindow mV2XWindow;
private IV2XButton mV2XButton;
@@ -56,7 +59,7 @@ public abstract class AbsV2XScenario<T> implements IV2XScenario, IV2XWindowManag
@Override
public void speakTTSVoice(@Nullable String msg, IMogoVoiceCmdCallBack callBack) {
if (!TextUtils.isEmpty(msg)) {
Logger.d(V2XConst.MODULE_NAME, "调用TTS播放语音" + msg);
Logger.d(TAG, "调用TTS播放语音" + msg);
AIAssist.getInstance(V2XUtils.getApp()).speakTTSVoice(msg, VoicePreemptType.PREEMPT_TYPE_IMMEADIATELY, callBack);
}
}
@@ -101,8 +104,4 @@ public abstract class AbsV2XScenario<T> implements IV2XScenario, IV2XWindowManag
return mV2XMessageEntity.equals(v2XMessageEntity);
}
@Override
public void removeAllTipWindow() {
close();
}
}

View File

@@ -111,11 +111,11 @@ public class V2XScenarioManager implements IV2XScenarioManager {
mV2XScenario = new V2XOptimalRouteVREventScenario();
break;
case V2XMessageEntity.V2XTypeEnum.ALERT_THE_FRONT_WEAKNESS:
// mV2XScenario = new V2XFrontWarningScenario();
// if (V2XServiceManager.getMoGoStatusManager().isVrMode()) {
// } else {
// mV2XScenario = null;
// }
if (V2XServiceManager.getMoGoStatusManager().isVrMode()) {
mV2XScenario = new V2XFrontWarningScenario();
} else {
mV2XScenario = null;
}
break;
default:
mV2XScenario = null;
@@ -146,7 +146,7 @@ public class V2XScenarioManager implements IV2XScenarioManager {
private void sceneChange() {
if (MogoApisHandler.getInstance().getApis().getMapServiceApi().getMapUIController().
getCurrentMapVisualAngle() != VisualAngleMode.MODE_MEDIUM_SIGHT) {
V2XServiceManager.getMapService().getMapUIController().changeMapVisualAngle(VisualAngleMode.MODE_MEDIUM_SIGHT,null);
V2XServiceManager.getMapService().getMapUIController().changeMapVisualAngle(VisualAngleMode.MODE_MEDIUM_SIGHT, null);
}
}

View File

@@ -2,15 +2,20 @@ package com.mogo.module.v2x.scenario.scene;
import android.content.Context;
import android.util.AttributeSet;
import android.util.Log;
import android.widget.RelativeLayout;
import com.mogo.module.common.MogoApisHandler;
import com.mogo.module.service.receiver.MogoReceiver;
import com.mogo.module.v2x.V2XServiceManager;
import com.mogo.service.v2x.IV2XWindowManagerListener;
import com.mogo.utils.logger.Logger;
/**
* @author donghongyu
* @date 12/11/20 10:35 AM
*/
public class V2XBasWindow extends RelativeLayout {
public class V2XBasWindow extends RelativeLayout implements IV2XWindowManagerListener {
private final String TAG = "V2XBasWindow";
public V2XBasWindow(Context context) {
@@ -28,6 +33,7 @@ public class V2XBasWindow extends RelativeLayout {
@Override
protected void onAttachedToWindow() {
super.onAttachedToWindow();
MogoApisHandler.getInstance().getApis().getV2XListenerManager().registerIntentListener(MogoReceiver.ACTION_V2X_FRONT_WARNING, this);
Logger.w(TAG, "onAttachedToWindow……");
}
@@ -44,4 +50,13 @@ public class V2XBasWindow extends RelativeLayout {
protected void release() {
Logger.w(TAG, "release……");
}
@Override
public void removeTipWindowByListener() {
Log.d(TAG, "removeAllTipWindow");
V2XServiceManager
.getMogoTopViewManager()
.removeView(this);
}
}

View File

@@ -5,6 +5,7 @@ import android.graphics.Color;
import android.os.Handler;
import android.os.Looper;
import android.os.Message;
import android.util.Log;
import com.mogo.commons.debug.DebugConfig;
import com.mogo.commons.voice.AIAssist;
@@ -20,6 +21,7 @@ import com.mogo.module.v2x.V2XServiceManager;
import com.mogo.module.v2x.listener.V2XWindowStatusListener;
import com.mogo.module.v2x.scenario.impl.AbsV2XScenario;
import com.mogo.module.v2x.utils.DrivingDirectionUtils;
import com.mogo.module.v2x.utils.ToastUtils;
import com.mogo.utils.logger.Logger;
import com.zhidao.mogo.module.obu.ObuConstant;
import com.zhidao.mogo.module.obu.obu.bean.MogoObuEventInfo;
@@ -40,7 +42,10 @@ import static com.mogo.module.v2x.V2XConst.MODULE_NAME;
*/
public class V2XObuEventScenario extends AbsV2XScenario<V2XObuEventEntity> implements Handler.Callback {
public static final String URGENCY_COLLISION_WARN_TEXT = "前车急刹,注意保持安全距离!";
public static final String URGENCY_COLLISION_WARN_TEXT_ONE = "前车急刹,注意保持安全距离!";
public static final String URGENCY_COLLISION_WARN_TEXT = "前车急刹";
public static final String URGENCY_CROING_WARN_TEXT = "注意交叉路口车辆";
private static final int MSG_CLOSE_OBU_WINDOW = 1001;
private static final int DEFAULT_EXPIRE_TIME = 20_000;
@@ -107,7 +112,12 @@ public class V2XObuEventScenario extends AbsV2XScenario<V2XObuEventEntity> imple
} else {
optimalSpeedMarker.clearPOI();
}
} else if (v2XMessageEntity.getContent().getType() == ObuConstant.TYPE_CROSS_COLLISION_WARNING) {
AIAssist.getInstance(V2XServiceManager.getContext()).speakTTSVoice(URGENCY_CROING_WARN_TEXT);
} else if (v2XMessageEntity.getContent().getType() == ObuConstant.TYPE_URGENCY_COLLISION_WARNING) {
AIAssist.getInstance(V2XServiceManager.getContext()).speakTTSVoice(URGENCY_COLLISION_WARN_TEXT_ONE);
}
show();
}
@@ -118,7 +128,7 @@ public class V2XObuEventScenario extends AbsV2XScenario<V2XObuEventEntity> imple
*/
@Override
public void show() {
AIAssist.getInstance(V2XServiceManager.getContext()).speakTTSVoice(getV2XMessageEntity().getContent().getDesc());
// AIAssist.getInstance(V2XServiceManager.getContext()).speakTTSVoice(URGENCY_COLLISION_WARN_TEXT_ONE);
showWindow();
if (handler.hasMessages(MSG_CLOSE_OBU_WINDOW)) {
handler.removeMessages(MSG_CLOSE_OBU_WINDOW);

View File

@@ -17,6 +17,7 @@ import com.mogo.module.v2x.R;
import com.mogo.module.v2x.V2XServiceManager;
import com.mogo.module.v2x.listener.V2XWindowStatusListener;
import com.mogo.module.v2x.scenario.view.IV2XWindow;
import com.mogo.module.v2x.utils.ToastUtils;
import com.mogo.service.windowview.IMogoTopViewStatusListener;
import com.mogo.utils.logger.Logger;
import com.zhidao.mogo.module.obu.ObuConstant;
@@ -47,7 +48,7 @@ public class V2XObuEventWindow extends FrameLayout implements IV2XWindow<V2XObuE
private void initView(Context context){
Logger.d(MODULE_NAME,"初始化obu场景view");
LayoutInflater.from(context).inflate(R.layout.window_simple_obu_event_detail, this);
LayoutInflater.from(context).inflate(R.layout.window_simple_obu_event_detail_vr, this);
ivTypeIcon = findViewById(R.id.ivObuTypeIcon);
tvType = findViewById(R.id.tvObuType);
tvDesc = findViewById(R.id.tvObuDesc);
@@ -65,6 +66,7 @@ public class V2XObuEventWindow extends FrameLayout implements IV2XWindow<V2XObuE
@Override
public void show(V2XObuEventEntity entity) {
Logger.d(MODULE_NAME, "ObuEventWindow show " + entity);
Logger.d("liyz", "ObuEventWindow show " + entity);
switch (entity.getType()) {
case ObuConstant
.TYPE_OPTIMAL_SPEED_ADVISORY:
@@ -75,12 +77,19 @@ public class V2XObuEventWindow extends FrameLayout implements IV2XWindow<V2XObuE
tvType.setBackgroundResource(R.drawable.bg_v2x_event_type_green);
break;
case ObuConstant.TYPE_URGENCY_COLLISION_WARNING:
// 前车急刹预警
ivTypeIcon.setImageResource(R.drawable.v2x_icon_obu_urgency_collision);
// 前车急刹预警 v2x_icon_obu_urgency_collision
ivTypeIcon.setImageResource(R.drawable.v2x_icon_ahead_car_brake);
tvDesc.setText(entity.getDesc());
tvType.setText("前车急刹");
tvType.setBackgroundResource(R.drawable.bg_v2x_event_type_read);
break;
case ObuConstant.TYPE_CROSS_COLLISION_WARNING:
// 交叉路口碰撞预警
ivTypeIcon.setImageResource(R.drawable.v2x_icon_car_collide_warning);
tvDesc.setText(entity.getDesc());
tvType.setText("交叉路口碰撞预警");
tvType.setBackgroundResource(R.drawable.bg_v2x_event_type_read);
break;
case ObuConstant.TYPE_CHANGE_LIGHT_FOR_VIP:
// vip变灯提醒
ivTypeIcon.setImageResource(R.drawable.v2x_icon_obu_traffic_light);

View File

@@ -79,8 +79,6 @@ public class V2XWarningMarker implements IV2XMarker {
Log.d(TAG, "显示时间为++" + String.valueOf(showTime));
pointsBetween();
bearing = V2XLocationListener.getInstance().getLastCarLocation().getBearing();
//预警蒙层
MarkerServiceHandler.getApis().getV2XListenerManager().warningChangedForListenerWithDirection(mCloundWarningInfo.getDirection(), MogoReceiver.ACTION_V2X_FRONT_WARNING);
isSelfLineClear = false;
isFirstLocation = false;
V2XServiceManager.getMarkerManager().removeMarkers(WARNING_ARROWS);
@@ -127,6 +125,9 @@ public class V2XWarningMarker implements IV2XMarker {
isSelfLineClear = true;
}, showTime);
}
//预警蒙层
MarkerServiceHandler.getApis().getV2XListenerManager().warningChangedForListenerWithDirection(mCloundWarningInfo.getDirection(), MogoReceiver.ACTION_V2X_FRONT_WARNING);
}
/**

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

View File

@@ -5,6 +5,7 @@
android:layout_width="@dimen/module_v2x_fault_help_width"
android:layout_height="@dimen/module_v2x_fault_help_height"
android:layout_marginTop="@dimen/dp_8"
android:alpha="0.7"
android:background="@drawable/bg_v2x_event_bg"
tools:layout_height="wrap_content">
@@ -39,7 +40,7 @@
android:paddingBottom="@dimen/dp_5"
android:text="求助"
android:textColor="@android:color/white"
android:textSize="@dimen/sp_20"
android:textSize="@dimen/module_v2x_fault_help_img_content_text_size"
android:textStyle="bold"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="@id/ivFaultHelpHead"

View File

@@ -0,0 +1,34 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:orientation="vertical"
tools:parentTag="androidx.constraintlayout.widget.ConstraintLayout">
<ImageView
android:id="@+id/ivBg"
android:layout_width="@dimen/dp_300"
android:layout_height="@dimen/dp_300"
android:gravity="center"
android:orientation="vertical"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:src="@drawable/v_to_x_warning_circle_red_00040" />
<ImageView
android:id="@+id/ivCar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:rotation="45"
app:layout_constraintBottom_toBottomOf="@+id/ivBg"
app:layout_constraintEnd_toEndOf="@+id/ivBg"
app:layout_constraintStart_toStartOf="@+id/ivBg"
app:layout_constraintTop_toTopOf="@+id/ivBg"
tools:src="@drawable/v_to_x_warning_car_red" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -29,7 +29,7 @@
android:paddingRight="@dimen/dp_10"
android:paddingBottom="@dimen/dp_3"
android:text="前车急刹"
android:textColor="@color/white"
android:textColor="@color/v2x_white"
android:textSize="@dimen/dp_24"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintLeft_toRightOf="@+id/ivObuTypeIcon"

View File

@@ -0,0 +1,55 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="wrap_content"
android:layout_height="@dimen/module_v2x_brake_tip_height"
android:layout_marginTop="@dimen/dp_20"
android:layout_gravity="center_horizontal"
android:background="@drawable/v2x_front_warning_bg">
<!-- @dimen/module_v2x_brake_tip_width-->
<ImageView
android:id="@+id/ivObuTypeIcon"
android:layout_width="@dimen/module_v2x_brake_image_width"
android:layout_height="@dimen/module_v2x_brake_image_width"
android:layout_marginStart="@dimen/module_v2x_brake_image_margin_left"
android:src="@drawable/v2x_icon_ahead_car_brake"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/tvObuType"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_20"
android:background="@drawable/bg_v2x_event_type_read"
android:gravity="center"
android:paddingLeft="@dimen/dp_10"
android:paddingTop="@dimen/dp_3"
android:paddingRight="@dimen/dp_10"
android:paddingBottom="@dimen/dp_3"
android:text="前车急刹"
android:textColor="@color/v2x_white"
android:textSize="@dimen/dp_24"
android:visibility="gone"
app:layout_constraintBottom_toTopOf="@+id/tvObuDesc"
app:layout_constraintLeft_toRightOf="@+id/ivObuTypeIcon"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_chainStyle="packed" />
<TextView
android:id="@+id/tvObuDesc"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/module_v2x_brake_image_margin_right"
android:layout_marginTop="@dimen/dp_10"
android:text="前车急刹"
android:textColor="@color/v2x_white"
android:textSize="@dimen/dp_32"
android:paddingRight="@dimen/module_v2x_brake_image_margin_left"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="@+id/tvObuType"
app:layout_constraintTop_toBottomOf="@+id/tvObuType" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -21,6 +21,7 @@
<dimen name="module_v2x_fatigue_driving_window_height_ground">234px</dimen>
<dimen name="module_v2x_fault_help_width">1067px</dimen>
<dimen name="module_v2x_fault_help_height">187px</dimen>
<dimen name="module_v2x_fault_help_img_content_text_size">28px</dimen>
<dimen name="module_v2x_fault_help_img_content_width">107px</dimen>
<dimen name="module_v2x_fault_help_img_content_height">47px</dimen>
@@ -29,7 +30,7 @@
<dimen name="module_v2x_fault_help_name_text_size">48px</dimen>
<dimen name="module_v2x_fault_help_time_margin_bottom">35px</dimen>
<dimen name="module_v2x_fault_help_time_text_size">36px</dimen>
<dimen name="module_v2x_fault_help_distance_text_size">64px</dimen>
<dimen name="module_v2x_fault_help_distance_text_size">80px</dimen>
<dimen name="module_v2x_fault_help_event_call_width">108px</dimen>
<dimen name="module_v2x_fault_help_event_navi_margin_right">53px</dimen>

View File

@@ -147,6 +147,7 @@
<dimen name="module_v2x_fault_help_width">800px</dimen>
<dimen name="module_v2x_fault_help_height">140px</dimen>
<dimen name="module_v2x_fault_help_img_content_text_size">20px</dimen>
<dimen name="module_v2x_fault_help_img_content_width">80px</dimen>
<dimen name="module_v2x_fault_help_img_content_height">35px</dimen>

View File

@@ -7,5 +7,5 @@ package com.mogo.service.v2x;
*/
public interface IV2XWindowManagerListener {
//移除v2x的所有道路事件及预警弹框
void removeAllTipWindow();
void removeTipWindowByListener();
}

View File

@@ -5,7 +5,6 @@ import android.content.Context;
import android.content.Intent;
import android.os.Handler;
import android.os.Message;
import android.os.RemoteException;
import android.text.TextUtils;
import android.util.Log;
@@ -47,7 +46,6 @@ import com.zhidao.adasconfig.api.AdasConfigApiController;
import com.zhidao.adasconfig.common.config.EnumCarChatIncognitoMode;
import com.zhidao.adasconfig.common.config.EnumCarHeading;
import com.zhidao.adasconfig.common.config.EnumSkinStyle;
import com.zhidao.autopilot.support.api.AutopilotServiceManage;
import com.zhidao.autopilotservice.model.AdasAIDLAutopilotArriveModel;
import com.zhidao.autopilotservice.model.AdasAIDLAutopilotStateModel;
import com.zhidao.autopilotservice.model.AdasAIDLOwnerCarRectModel;
@@ -298,7 +296,8 @@ public class MogoADASController implements IMogoADASController {
@Override
public void killADAS() {
try {
AutopilotServiceManage.getInstance().kill();
//AutopilotServiceManage.getInstance().kill();
adasProvider.killAdas();
} catch (Exception e) {
}
@@ -306,6 +305,16 @@ public class MogoADASController implements IMogoADASController {
private volatile boolean needEmphasizeMyLocation = false;
private void testOCH() {
RemoteControlAutoPilotParameters currentAutopilot = new RemoteControlAutoPilotParameters();
currentAutopilot.isSpeakVoice = true;
currentAutopilot.startLatLon = new RemoteControlAutoPilotParameters.AutoPilotLonLat( 0, 1 );
currentAutopilot.endLatLon = new RemoteControlAutoPilotParameters.AutoPilotLonLat( 2, 3 );
currentAutopilot.vehicleType = 10;
Logger.d( TAG, "开启自动驾驶====" + currentAutopilot );
aiCloudToAdasData(currentAutopilot);
}
@Override
public void showADAS() {
@@ -328,6 +337,9 @@ public class MogoADASController implements IMogoADASController {
info.setSn(MoGoAiCloudClientConfig.getInstance().getSn());
AdasManager.getInstance().setBasicInfo(info);
invokeShowADASOperation();
//测试网约车
//testOCH();
}
@Override
@@ -386,7 +398,8 @@ public class MogoADASController implements IMogoADASController {
// 向adas发送车模list
String carModelList = SharedPrefsMgr.getInstance(context).getString("CAR_MODEL_LIST", "");
if (carModelList != null && !carModelList.isEmpty()) {
AutopilotServiceManage.getInstance().settingCarModelListInfo(carModelList);
//AutopilotServiceManage.getInstance().settingCarModelListInfo(carModelList);
adasProvider.settingCarModelListInfo(carModelList);
}
// 此处进行网络请求请求成功后再通知一次adas
requestCarModelList();
@@ -530,7 +543,8 @@ public class MogoADASController implements IMogoADASController {
}
try {
AutopilotServiceManage.getInstance().showAdas();
//AutopilotServiceManage.getInstance().showAdas();
adasProvider.showAdas();
} catch (Exception e) {
Intent intent = new Intent(ACTION);
intent.putExtra(PARAM_COMMAND, VAL_COMMAND);
@@ -553,7 +567,8 @@ public class MogoADASController implements IMogoADASController {
Logger.d(TAG, "close adas");
try {
AutopilotServiceManage.getInstance().hideAdas();
//AutopilotServiceManage.getInstance().hideAdas();
adasProvider.hideAdas();
} catch (Exception e) {
Intent intent = new Intent(ACTION);
intent.putExtra(PARAM_COMMAND, VAL_COMMAND);
@@ -582,7 +597,7 @@ public class MogoADASController implements IMogoADASController {
@Override
public void init(Context context) {
AutopilotServiceManage.getInstance().init(context);
//AutopilotServiceManage.getInstance().init(context);
mIsReleased = false;
mAdasMessageFactory = new MyMessageFactory();
adasProvider = ARouter.getInstance().navigation(AdasProvider.class);
@@ -591,12 +606,14 @@ public class MogoADASController implements IMogoADASController {
@Override
public void setSettingStatus(boolean show) {
AutopilotServiceManage.getInstance().setSettingStatus(show);
//AutopilotServiceManage.getInstance().setSettingStatus(show);
adasProvider.setSettingStatus(show);
}
@Override
public void setUseAlgorithm(boolean open) {
AutopilotServiceManage.getInstance().setUseAlgorithm(open);
//AutopilotServiceManage.getInstance().setUseAlgorithm(open);
adasProvider.setUseAlgorithm(open);
}
@Override
@@ -667,7 +684,8 @@ public class MogoADASController implements IMogoADASController {
AdasControlCommandParameter parameter = new AdasControlCommandParameter(action, result);
//位置信息 action是aiCloudToStartAutopilot
try {
AutopilotServiceManage.getInstance().aiCloudToAdasData(GsonUtil.jsonFromObject(parameter));
//AutopilotServiceManage.getInstance().aiCloudToAdasData(GsonUtil.jsonFromObject(parameter));
adasProvider.sendWsMessage(GsonUtil.jsonFromObject(parameter));
} catch (Exception e) {
e.printStackTrace();
}
@@ -695,7 +713,8 @@ public class MogoADASController implements IMogoADASController {
String value = GsonUtil.jsonFromObject(o.getResult());
SharedPrefsMgr.getInstance(context).putString("CAR_MODEL_LIST", value);
if (value != null && !value.isEmpty()) {
AutopilotServiceManage.getInstance().settingCarModelListInfo(value);
//AutopilotServiceManage.getInstance().settingCarModelListInfo(value);
adasProvider.settingCarModelListInfo(value);
}
}
@@ -719,7 +738,8 @@ public class MogoADASController implements IMogoADASController {
mIsReleased = true;
//AutopilotServiceManage.getInstance().unRegisterAutopilotDataListener( mAutopolitDataCallBack );
adasProvider.removeAdasEventListener(mAdasDataListener);
AutopilotServiceManage.getInstance().release();
adasProvider.removeAdasStatusListener();
//AutopilotServiceManage.getInstance().release();
}
@Override
@@ -829,7 +849,8 @@ public class MogoADASController implements IMogoADASController {
}
int status = IMogoAdasOCHCallback.STATUS_AUTOPILOT_DISABLE;
try {
status = AutopilotServiceManage.getInstance().autopilotStateCall().getState();
//status = AutopilotServiceManage.getInstance().autopilotStateCall().getState();
status = adasProvider.autopilotStateCall().getState();
} catch (Exception e) {
e.printStackTrace();
}
@@ -854,11 +875,12 @@ public class MogoADASController implements IMogoADASController {
@Override
public void cancelAutopilot() {
try {
AutopilotServiceManage.getInstance().cancelAutopilot();
} catch (RemoteException e) {
e.printStackTrace();
}
//try {
//AutopilotServiceManage.getInstance().cancelAutopilot();
adasProvider.cancelPolit();
//} catch (RemoteException e) {
// e.printStackTrace();
//}
}
@Override

View File

@@ -49,7 +49,7 @@ class MogoLocationInfoService implements IMogoLocationInfoService {
public void init( Context context ) {
try {
Class< ? > clazz = Class.forName( "com.mogo.base.services.locationinfo.MogoLocationInfoServices" );
Class< ? > clazz = Class.forName( "com.mogo.aicloud.services.locationinfo.MogoLocationInfoServices" );
Method getInstanceMethod = clazz.getMethod( "getInstance" );
getInstanceMethod.setAccessible( true );
mDelegate = ( IMogoLocationInfoService ) getInstanceMethod.invoke( null );

View File

@@ -159,7 +159,7 @@ public class MogoStatusManager implements IMogoStatusManager {
private boolean get_bool_val(StatusDescriptor descriptor ) {
Boolean val = mStatus.get( descriptor );
return val == null ? false : val;
return val != null && val;
}
@Override
@@ -169,7 +169,6 @@ public class MogoStatusManager implements IMogoStatusManager {
@Override
public void setVrMode(String tag, boolean vrMode) {
Log.d("liyz", "setVrMode --------> ");
doSetStatus(tag, StatusDescriptor.VR_MODE, vrMode);
}

View File

@@ -61,7 +61,7 @@ public class V2XManager implements IV2XProvider {
if (listeners != null && !listeners.isEmpty()) {
for (IV2XWindowManagerListener listener : listeners) {
if (listener != null) {
listener.removeAllTipWindow();
listener.removeTipWindowByListener();
}
}
}

View File

@@ -1,13 +1,17 @@
package com.mogo.test.crashreport.bugly;
import android.content.Context;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageManager;
import android.os.Bundle;
import android.text.TextUtils;
import android.util.Log;
import com.alibaba.android.arouter.facade.annotation.Route;
import com.mogo.cloud.passport.MoGoAiCloudClientConfig;
import com.mogo.commons.network.Utils;
import com.mogo.test.crashreport.CrashReportConstants;
import com.mogo.test.crashreport.ITestCrashReportProvider;
import com.mogo.utils.AppUtils;
import com.mogo.utils.logger.Logger;
import com.tencent.bugly.crashreport.CrashReport;
@@ -28,7 +32,7 @@ class BuglyCrashReportProvider implements ITestCrashReportProvider {
private static final String TAG = "BuglyCrashReportProvider";
@Override
public void init( Context context ) {
public void init(Context context ) {
Logger.d(TAG, "init");
String packageName = context.getPackageName();
String processName = getProcessName( android.os.Process.myPid() );
@@ -36,6 +40,8 @@ class BuglyCrashReportProvider implements ITestCrashReportProvider {
strategy.setUploadProcess( processName == null || processName.equals( packageName ) );
CrashReport.initCrashReport( context, "f3f8b0b2f1", true, strategy );
CrashReport.putUserData( context, "serial", MoGoAiCloudClientConfig.getInstance().getSn() );
String mapSDKVersion = AppUtils.getCustomMapSDKVersion(context);
CrashReport.putUserData( context, "MAP_SDK_VERSION",mapSDKVersion );
}
/**

View File

@@ -2,11 +2,13 @@ package com.mogo.test.crashreport.upgrade;
import android.content.Context;
import android.text.TextUtils;
import android.util.Log;
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.network.Utils;
import com.mogo.utils.AppUtils;
import com.mogo.utils.logger.Logger;
import com.tencent.bugly.Bugly;
import com.tencent.bugly.crashreport.CrashReport;
@@ -41,6 +43,8 @@ public class UpgradeReportProvider implements IProvider {
CrashReport.putUserData(context, "serial", MoGoAiCloudClientConfig.getInstance().getSn());
Bugly.init(context, "f3f8b0b2f1", true, strategy);
String mapSDKVersion = AppUtils.getCustomMapSDKVersion(context);
CrashReport.putUserData( context, "MAP_SDK_VERSION",mapSDKVersion );
}
/**