wait to finish
This commit is contained in:
@@ -0,0 +1,51 @@
|
||||
package com.mogo.module.adas;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import com.mogo.module.adas.entity.AdasAutoPilotLocReceiverBean;
|
||||
import com.mogo.module.common.MogoApisHandler;
|
||||
import com.mogo.service.connection.IMogoOnMessageListener;
|
||||
|
||||
public class AdasAutoPilotManager implements IMogoOnMessageListener<AdasAutoPilotLocReceiverBean> {
|
||||
|
||||
private static volatile AdasAutoPilotManager instance;
|
||||
private static final byte[] obj = new byte[0];
|
||||
private static final int MSG_SOCKET_TYPE = 1;
|
||||
private Context mContext;
|
||||
|
||||
private AdasAutoPilotManager() {
|
||||
|
||||
}
|
||||
|
||||
public static AdasAutoPilotManager getInstance() {
|
||||
if (instance == null) {
|
||||
synchronized (obj) {
|
||||
if (instance == null) {
|
||||
instance = new AdasAutoPilotManager();
|
||||
}
|
||||
}
|
||||
}
|
||||
return instance;
|
||||
}
|
||||
|
||||
public void initSocket(Context context) {
|
||||
this.mContext = context;
|
||||
MogoApisHandler.getInstance()
|
||||
.getApis()
|
||||
.getSocketManagerApi(mContext).registerOnMessageListener(MSG_SOCKET_TYPE, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<AdasAutoPilotLocReceiverBean> target() {
|
||||
return AdasAutoPilotLocReceiverBean.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onMsgReceived(AdasAutoPilotLocReceiverBean adasAutoPilotLocReceiverBean) {
|
||||
if (adasAutoPilotLocReceiverBean != null
|
||||
&& adasAutoPilotLocReceiverBean.getLat() != 0.0
|
||||
&& adasAutoPilotLocReceiverBean.getLon() != 0.0) {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,11 +1,12 @@
|
||||
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.adas.entity.AutonomousDriveStatusBean;
|
||||
import com.mogo.module.adas.entity.ReportSiteBean;
|
||||
import com.mogo.module.adas.entity.WarnMessageModel;
|
||||
import com.mogo.module.common.MogoApisHandler;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
import com.mogo.utils.network.RequestOptions;
|
||||
|
||||
@@ -6,7 +6,6 @@ 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;
|
||||
|
||||
@@ -26,9 +25,9 @@ public class AdasProvider implements IProvider {
|
||||
@Override
|
||||
public void init(Context context) {
|
||||
Logger.d(TAG, "初始化 AdasProvider 模块");
|
||||
|
||||
adasEventManager = new AdasEventManager();
|
||||
initAdas(context, adasEventManager);
|
||||
initAutoPilotBusiness();
|
||||
}
|
||||
|
||||
private void initAdas(Context context, AdasEventManager adasEventManager) {
|
||||
@@ -37,6 +36,10 @@ public class AdasProvider implements IProvider {
|
||||
AdasManager.getInstance().setOnAdasConnectStatusListener(adasEventManager);
|
||||
}
|
||||
|
||||
private void initAutoPilotBusiness() {
|
||||
AdasAutoPilotManager.getInstance().initSocket();
|
||||
}
|
||||
|
||||
public void addAdasEventListener(AdasDataListener listener) {
|
||||
adasEventManager.addEventListener(listener);
|
||||
}
|
||||
@@ -61,7 +64,7 @@ public class AdasProvider implements IProvider {
|
||||
AdasManager.getInstance().aiCloudToAdasData(msg);
|
||||
}
|
||||
|
||||
public void cancelPolit() {
|
||||
public void cancelPilot() {
|
||||
if (AdasManager.getInstance().isSocketConnect()) {
|
||||
AdasManager.getInstance().controlAutopilotCarHead();
|
||||
}
|
||||
|
||||
@@ -0,0 +1,69 @@
|
||||
package com.mogo.module.adas.entity;
|
||||
|
||||
public class AdasAutoPilotLocReceiverBean {
|
||||
|
||||
private int poiId;
|
||||
private double lat;
|
||||
private double lon;
|
||||
private String poiAddress;
|
||||
private long systemTime;
|
||||
|
||||
public AdasAutoPilotLocReceiverBean(int poiId, double lat, double lon, String poiAddress, long systemTime) {
|
||||
this.poiId = poiId;
|
||||
this.lat = lat;
|
||||
this.lon = lon;
|
||||
this.poiAddress = poiAddress;
|
||||
this.systemTime = systemTime;
|
||||
}
|
||||
|
||||
public int getPoiId() {
|
||||
return poiId;
|
||||
}
|
||||
|
||||
public void setPoiId(int poiId) {
|
||||
this.poiId = poiId;
|
||||
}
|
||||
|
||||
public double getLat() {
|
||||
return lat;
|
||||
}
|
||||
|
||||
public void setLat(double lat) {
|
||||
this.lat = lat;
|
||||
}
|
||||
|
||||
public double getLon() {
|
||||
return lon;
|
||||
}
|
||||
|
||||
public void setLon(double lon) {
|
||||
this.lon = lon;
|
||||
}
|
||||
|
||||
public String getPoiAddress() {
|
||||
return poiAddress;
|
||||
}
|
||||
|
||||
public void setPoiAddress(String poiAddress) {
|
||||
this.poiAddress = poiAddress;
|
||||
}
|
||||
|
||||
public long getSystemTime() {
|
||||
return systemTime;
|
||||
}
|
||||
|
||||
public void setSystemTime(long systemTime) {
|
||||
this.systemTime = systemTime;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "AdasAutoPilotLocReceiverBean{" +
|
||||
"poiId=" + poiId +
|
||||
", lat=" + lat +
|
||||
", lon=" + lon +
|
||||
", poiAddress='" + poiAddress + '\'' +
|
||||
", systemTime=" + systemTime +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mogo.module.adas;
|
||||
package com.mogo.module.adas.entity;
|
||||
|
||||
/**
|
||||
* Created by XuYong on 2021/5/28 16:12
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mogo.module.adas;
|
||||
package com.mogo.module.adas.entity;
|
||||
|
||||
/**
|
||||
* Created by XuYong on 2021/5/31 16:24
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mogo.module.adas;
|
||||
package com.mogo.module.adas.entity;
|
||||
|
||||
import com.zhidao.support.adas.high.bean.WarnMessageInfo;
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.mogo.module.adas.view;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.mogo.module.adas.R;
|
||||
import com.mogo.module.common.dialog.BaseFloatDialog;
|
||||
|
||||
public class DispatchRemindDialog extends BaseFloatDialog {
|
||||
|
||||
public DispatchRemindDialog(@NonNull Context context) {
|
||||
super(context);
|
||||
setContentView(R.layout.dialog_adas_dispatch_remind);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<dimen name="adas_dispatch_remind_dialog_width">950px</dimen>
|
||||
<dimen name="adas_dispatch_remind_dialog_height">540px</dimen>
|
||||
<dimen name="adas_dispatch_remind_dialog_corner">32px</dimen>
|
||||
</resources>
|
||||
4
modules/mogo-module-adas/src/main/res/values/colors.xml
Normal file
4
modules/mogo-module-adas/src/main/res/values/colors.xml
Normal file
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<color name="adas_dispatch_remind_loc">#1F9BFE</color>
|
||||
</resources>
|
||||
6
modules/mogo-module-adas/src/main/res/values/dimens.xml
Normal file
6
modules/mogo-module-adas/src/main/res/values/dimens.xml
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<dimen name="adas_dispatch_remind_dialog_width">950px</dimen>
|
||||
<dimen name="adas_dispatch_remind_dialog_height">540px</dimen>
|
||||
<dimen name="adas_dispatch_remind_dialog_corner">32px</dimen>
|
||||
</resources>
|
||||
Reference in New Issue
Block a user