Merge branch 'dev_hengyang_base' of http://gitlab.zhidaoauto.com/ecos/yycp-service/Launcher into dev_hengyang_base
This commit is contained in:
2
.idea/misc.xml
generated
2
.idea/misc.xml
generated
@@ -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>
|
||||
1
.idea/runConfigurations.xml
generated
1
.idea/runConfigurations.xml
generated
@@ -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" />
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 2.3 KiB |
@@ -2,13 +2,13 @@
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:state_checked="true">
|
||||
<shape android:shape="rectangle">
|
||||
<corners android:bottomLeftRadius="20px" android:bottomRightRadius="45px" android:topLeftRadius="45px" android:topRightRadius="20px" />
|
||||
<corners android:bottomLeftRadius="30px" android:bottomRightRadius="130px" android:topLeftRadius="130px" android:topRightRadius="30px" />
|
||||
<gradient android:angle="315" android:endColor="#2B6EFF" android:startColor="#2B6EFF" />
|
||||
</shape>
|
||||
</item>
|
||||
<item>
|
||||
<shape android:shape="rectangle">
|
||||
<corners android:bottomLeftRadius="20px" android:bottomRightRadius="45px" android:topLeftRadius="45px" android:topRightRadius="20px" />
|
||||
<corners android:bottomLeftRadius="30px" android:bottomRightRadius="130px" android:topLeftRadius="130px" android:topRightRadius="30px" />
|
||||
<gradient android:angle="315" android:endColor="#3B4577" android:startColor="#3B4577" />
|
||||
</shape>
|
||||
</item>
|
||||
|
||||
@@ -1,10 +1,14 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<corners android:radius="@dimen/module_mogo_och_autopilot_status_bg_corner" />
|
||||
android:shape="oval">
|
||||
<!-- <corners android:radius="@dimen/module_mogo_och_autopilot_status_bg_corner" />-->
|
||||
<gradient
|
||||
android:startColor="#323C6F"
|
||||
android:endColor="#323C6F"
|
||||
android:angle="315"/>
|
||||
|
||||
android:angle="315"
|
||||
/>
|
||||
<size
|
||||
android:width="120px"
|
||||
android:height="120px"
|
||||
/>
|
||||
</shape>
|
||||
@@ -2,7 +2,7 @@
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item>
|
||||
<shape>
|
||||
<corners android:radius="17px" />
|
||||
<corners android:radius="32px" />
|
||||
<solid android:color="#3B4577"/>
|
||||
</shape>
|
||||
</item>
|
||||
@@ -12,7 +12,7 @@
|
||||
android:right="3px"
|
||||
android:top="3px">
|
||||
<shape>
|
||||
<corners android:radius="17px" />
|
||||
<corners android:radius="32px" />
|
||||
<solid android:color="#3B4577"/>
|
||||
</shape>
|
||||
</item>
|
||||
|
||||
@@ -31,7 +31,8 @@
|
||||
<dimen name="module_mogo_och_autopilot_order_bg_height">414px</dimen>
|
||||
|
||||
|
||||
<dimen name="module_mogo_och_autopilot_status_text_size">44px</dimen>
|
||||
<!-- <dimen name="module_mogo_och_autopilot_status_text_size">44px</dimen>-->
|
||||
<dimen name="module_mogo_och_autopilot_status_text_size">49px</dimen>
|
||||
<dimen name="module_mogo_och_autopilot_status_text_padding_top">13px</dimen>
|
||||
<dimen name="module_mogo_och_autopilot_status_text_drawable_padding">12px</dimen>
|
||||
<dimen name="module_mogo_och_autopilot_status_text_m_l">350px</dimen>
|
||||
|
||||
@@ -171,7 +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',
|
||||
// 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}",
|
||||
// 左侧面板空实现
|
||||
|
||||
@@ -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() )
|
||||
|
||||
@@ -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 +
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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";
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
@@ -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 );
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
@@ -7,9 +7,14 @@
|
||||
<!-- <stroke-->
|
||||
<!-- android:width="1dp"-->
|
||||
<!-- android:color="#182155" />-->
|
||||
<!-- <corners-->
|
||||
<!-- android:bottomLeftRadius="@dimen/dp_100"-->
|
||||
<!-- android:bottomRightRadius="@dimen/dp_20"-->
|
||||
<!-- android:topLeftRadius="@dimen/dp_20"-->
|
||||
<!-- android:topRightRadius="@dimen/dp_100" />-->
|
||||
<corners
|
||||
android:bottomLeftRadius="@dimen/dp_100"
|
||||
android:bottomRightRadius="@dimen/dp_20"
|
||||
android:topLeftRadius="@dimen/dp_20"
|
||||
android:topRightRadius="@dimen/dp_100" />
|
||||
android:bottomLeftRadius="130px"
|
||||
android:bottomRightRadius="30px"
|
||||
android:topLeftRadius="30px"
|
||||
android:topRightRadius="130px" />
|
||||
</shape>
|
||||
@@ -5,7 +5,7 @@
|
||||
<dimen name="module_ext_speed_height">460px</dimen>
|
||||
<dimen name="module_ext_arcView_width">320px</dimen>
|
||||
<dimen name="module_ext_arcView_height">320px</dimen>
|
||||
<dimen name="module_ext_arcView_stroke_with">15px</dimen>
|
||||
<dimen name="module_ext_arcView_stroke_with">20px</dimen>
|
||||
<dimen name="module_ext_arcView_center_text_size">110px</dimen>
|
||||
<dimen name="module_ext_arcView_des_text_size">40px</dimen>
|
||||
<dimen name="module_switch_map">279px</dimen>
|
||||
|
||||
@@ -69,7 +69,7 @@
|
||||
<item>提前看看出行路况,试试唤醒小智说,“中关村路况怎么样”</item>
|
||||
</string-array>
|
||||
|
||||
<string name="module_map_model_normal">默认视角</string>
|
||||
<string name="module_map_model_normal">近距视角</string>
|
||||
<string name="module_map_model_faster">远距视角</string>
|
||||
|
||||
</resources>
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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()));
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 8.7 KiB |
@@ -94,7 +94,8 @@ 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.mebulaobu
|
||||
implementation rootProject.ext.dependencies.mogoobu
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -38,11 +38,20 @@ 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.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;
|
||||
@@ -94,9 +103,15 @@ public class V2XObuManager implements IObuCallback, Handler.Callback {
|
||||
obuManager.registerObuDataChangedListener(this);
|
||||
|
||||
//使用adas部门obu sdk (星云)
|
||||
NebulaObuClient.getInstance().init(context);
|
||||
NebulaObuClient.getInstance().registerObu(100);
|
||||
NebulaObuClient.getInstance().registerObuListener(listener);
|
||||
// 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 测试
|
||||
@@ -109,52 +124,127 @@ public class V2XObuManager implements IObuCallback, Handler.Callback {
|
||||
context.registerReceiver(obuTypeExchangeReceiver, filter);
|
||||
}
|
||||
|
||||
|
||||
public void release() {
|
||||
NebulaObuClient.getInstance().unregisterObu();
|
||||
NebulaObuClient.getInstance().unregisterObuListener();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 星云obu数据监听
|
||||
*/
|
||||
private OnObuListener listener = new OnObuListener() {
|
||||
private OnMogoObuListener mogoObuListener = new OnMogoObuListener() {
|
||||
@Override
|
||||
public void onRegister() {
|
||||
public void onConnected() {
|
||||
//OBU连接成功
|
||||
Logger.d("liyz", "onConnected ------> ");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onConnectFail(boolean isNeedReconnect) {
|
||||
Logger.d("liyz", "onConnectFail ------> ");
|
||||
//OBU连接失败
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUnregister() {
|
||||
public void onDisconnect() {
|
||||
Logger.d("liyz", "onDisconnect ------> ");
|
||||
//OBU断开连接
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onObuInfo(ObuInfo info) {
|
||||
Logger.d("liyz", "onObuInfo ------> " + info.toString());
|
||||
public void onReceiveOriginData(String data) {
|
||||
super.onReceiveOriginData(data);
|
||||
Logger.d("liyz", "onReceiveOriginData ------> data = " + data);
|
||||
//接收到的原始数据
|
||||
}
|
||||
|
||||
@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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
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);
|
||||
|
||||
@@ -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() ?
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -271,21 +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.zIndex(MarkerDrawer.MARKER_Z_INDEX_HIGH);
|
||||
options.icon3DRes(com.mogo.module.common.R.raw.othercar);
|
||||
options.anchorColor("#C6D83EFF");
|
||||
m3DMarker = V2XServiceManager.getMarkerManager().addMarker(V2X_EVENT_ALARM_POI, options);
|
||||
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);
|
||||
// 缩放地图
|
||||
|
||||
@@ -132,34 +132,6 @@ public class V2XMarkerAdapter {
|
||||
*/
|
||||
public static ArrayList<Bitmap> getV2XRoadEventOrangeMarkerView(Context context, V2XRoadEventEntity alarmInfo) {
|
||||
ArrayList<Bitmap> icons = new ArrayList<>();
|
||||
if (V2XServiceManager.getMoGoStatusManager().isVrMode()) {
|
||||
icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, com.mogo.module.service.R.drawable.module_service_ic_car_for_help_0000));
|
||||
icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, com.mogo.module.service.R.drawable.module_service_ic_car_for_help_0001));
|
||||
icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, com.mogo.module.service.R.drawable.module_service_ic_car_for_help_0002));
|
||||
icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, com.mogo.module.service.R.drawable.module_service_ic_car_for_help_0003));
|
||||
icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, com.mogo.module.service.R.drawable.module_service_ic_car_for_help_0004));
|
||||
icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, com.mogo.module.service.R.drawable.module_service_ic_car_for_help_0005));
|
||||
icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, com.mogo.module.service.R.drawable.module_service_ic_car_for_help_0006));
|
||||
icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, com.mogo.module.service.R.drawable.module_service_ic_car_for_help_0007));
|
||||
icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, com.mogo.module.service.R.drawable.module_service_ic_car_for_help_0008));
|
||||
icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, com.mogo.module.service.R.drawable.module_service_ic_car_for_help_0009));
|
||||
icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, com.mogo.module.service.R.drawable.module_service_ic_car_for_help_0010));
|
||||
icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, com.mogo.module.service.R.drawable.module_service_ic_car_for_help_0011));
|
||||
icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, com.mogo.module.service.R.drawable.module_service_ic_car_for_help_0012));
|
||||
icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, com.mogo.module.service.R.drawable.module_service_ic_car_for_help_0013));
|
||||
icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, com.mogo.module.service.R.drawable.module_service_ic_car_for_help_0014));
|
||||
icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, com.mogo.module.service.R.drawable.module_service_ic_car_for_help_0015));
|
||||
icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, com.mogo.module.service.R.drawable.module_service_ic_car_for_help_0016));
|
||||
icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, com.mogo.module.service.R.drawable.module_service_ic_car_for_help_0017));
|
||||
icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, com.mogo.module.service.R.drawable.module_service_ic_car_for_help_0018));
|
||||
icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, com.mogo.module.service.R.drawable.module_service_ic_car_for_help_0019));
|
||||
icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, com.mogo.module.service.R.drawable.module_service_ic_car_for_help_0020));
|
||||
icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, com.mogo.module.service.R.drawable.module_service_ic_car_for_help_0021));
|
||||
icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, com.mogo.module.service.R.drawable.module_service_ic_car_for_help_0022));
|
||||
icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, com.mogo.module.service.R.drawable.module_service_ic_car_for_help_0023));
|
||||
icons.add(V2XMarkerAdapter.getV2XRoadEventMarkerView(context, alarmInfo, com.mogo.module.service.R.drawable.module_service_ic_car_for_help_0024));
|
||||
|
||||
} else {
|
||||
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));
|
||||
@@ -198,8 +170,6 @@ public class V2XMarkerAdapter {
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
@@ -102,9 +102,7 @@ class V2XMarkerRoadEventView(context: Context, alarmInfo: V2XRoadEventEntity) :
|
||||
}
|
||||
// 故障车辆
|
||||
V2XPoiTypeEnum.ALERT_CAR_TROUBLE_WARNING.toString() -> {
|
||||
if (!V2XServiceManager.getMoGoStatusManager().isVrMode()) {
|
||||
ivCar.setImageResource(R.drawable.icon_car_red)
|
||||
}
|
||||
ivCar.setImageResource(R.drawable.icon_car_red)
|
||||
}
|
||||
// 取快递
|
||||
V2XPoiTypeEnum.ALERT_TRAFFIC_EXPRESS -> {
|
||||
|
||||
@@ -44,7 +44,7 @@ public class V2XObuEventScenario extends AbsV2XScenario<V2XObuEventEntity> imple
|
||||
|
||||
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 = "交叉路口碰撞预警";
|
||||
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;
|
||||
|
||||
@@ -85,7 +85,7 @@ public class V2XObuEventWindow extends FrameLayout implements IV2XWindow<V2XObuE
|
||||
break;
|
||||
case ObuConstant.TYPE_CROSS_COLLISION_WARNING:
|
||||
// 交叉路口碰撞预警
|
||||
ivTypeIcon.setImageResource(R.drawable.v2x_icon_ahead_car_brake);
|
||||
ivTypeIcon.setImageResource(R.drawable.v2x_icon_car_collide_warning);
|
||||
tvDesc.setText(entity.getDesc());
|
||||
tvType.setText("交叉路口碰撞预警");
|
||||
tvType.setBackgroundResource(R.drawable.bg_v2x_event_type_read);
|
||||
|
||||
@@ -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.6 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 6.7 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 4.6 KiB |
@@ -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">
|
||||
|
||||
|
||||
@@ -30,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>
|
||||
|
||||
@@ -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;
|
||||
@@ -301,7 +299,8 @@ public class MogoADASController implements IMogoADASController {
|
||||
@Override
|
||||
public void killADAS() {
|
||||
try {
|
||||
AutopilotServiceManage.getInstance().kill();
|
||||
//AutopilotServiceManage.getInstance().kill();
|
||||
adasProvider.killAdas();
|
||||
} catch (Exception e) {
|
||||
|
||||
}
|
||||
@@ -309,6 +308,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() {
|
||||
|
||||
@@ -331,6 +340,9 @@ public class MogoADASController implements IMogoADASController {
|
||||
info.setSn(MoGoAiCloudClientConfig.getInstance().getSn());
|
||||
AdasManager.getInstance().setBasicInfo(info);
|
||||
invokeShowADASOperation();
|
||||
|
||||
//测试网约车
|
||||
//testOCH();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -389,7 +401,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();
|
||||
@@ -533,7 +546,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);
|
||||
@@ -556,7 +570,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);
|
||||
@@ -585,7 +600,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);
|
||||
@@ -594,12 +609,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
|
||||
@@ -670,7 +687,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();
|
||||
}
|
||||
@@ -692,7 +710,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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -716,7 +735,8 @@ public class MogoADASController implements IMogoADASController {
|
||||
mIsReleased = true;
|
||||
//AutopilotServiceManage.getInstance().unRegisterAutopilotDataListener( mAutopolitDataCallBack );
|
||||
adasProvider.removeAdasEventListener(mAdasDataListener);
|
||||
AutopilotServiceManage.getInstance().release();
|
||||
adasProvider.removeAdasStatusListener();
|
||||
//AutopilotServiceManage.getInstance().release();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -826,7 +846,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();
|
||||
}
|
||||
@@ -851,11 +872,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
|
||||
|
||||
Reference in New Issue
Block a user