From a27476ffbed4dbe516726c48d3229e3f102cb49a Mon Sep 17 00:00:00 2001 From: donghongyu Date: Mon, 7 Feb 2022 14:41:57 +0800 Subject: [PATCH] =?UTF-8?q?[Delete]=20=E7=A7=BB=E9=99=A4=E5=BA=9F=E5=BC=83?= =?UTF-8?q?=E7=9A=84=E4=BA=91=E7=AB=AF=E8=B0=83=E5=BA=A6=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: donghongyu --- .../hmi/ui/setting/DebugSettingView.kt | 10 + .../CallerAutoPilotStatusListenerManager.kt | 2 +- ...CallerAutopilotCarStatusListenerManager.kt | 2 +- .../CallerAutopilotIdentifyListenerManager.kt | 2 +- .../module/adas/AdasAutoPilotManager.java | 269 ------------------ .../mogo/module/adas/AdasEventManager.java | 10 +- .../mogo/module/adas/IAdasDataListener.java | 9 - .../DispatchAdasAutoPilotLocReceiverBean.java | 165 ----------- .../mogo/module/adas/entity/DispatchData.java | 36 --- .../module/adas/entity/DispatchResult.java | 36 --- .../mogo/module/adas/entity/EndLatLon.java | 36 --- .../adas/entity/ReportDispatchResult.java | 36 --- .../module/adas/entity/ReportedRoute.java | 38 --- .../mogo/module/adas/entity/StartLatLon.java | 36 --- .../module/adas/model/AdasServiceModel.java | 119 +------- .../com/mogo/module/adas/model/IDispatch.java | 8 - .../module/adas/network/IAdasApiService.java | 45 +-- .../adas/overlay/LineOverlayManager.java | 90 ------ .../AdasTestPanelBroadCastReceiver.java | 15 +- .../adas/receiver/TestAdasFuncManager.java | 75 ----- .../adas/view/DispatchRemindDialog.java | 99 ------- .../res/drawable/module_adas_bg_shape.xml | 5 - .../drawable/module_adas_left_corner_bg.xml | 6 - .../drawable/module_adas_right_corner_bg.xml | 6 - .../drawable/module_adas_timer_bg_shape.xml | 4 - .../layout/dialog_adas_dispatch_remind.xml | 95 ------- .../res/values-xhdpi-2560x1440/dimens.xml | 15 +- .../src/main/res/values/colors.xml | 6 - .../src/main/res/values/dimens.xml | 15 +- .../src/main/res/values/strings.xml | 5 +- 30 files changed, 29 insertions(+), 1266 deletions(-) delete mode 100644 modules/mogo-module-adas/src/main/java/com/mogo/module/adas/AdasAutoPilotManager.java delete mode 100644 modules/mogo-module-adas/src/main/java/com/mogo/module/adas/entity/DispatchAdasAutoPilotLocReceiverBean.java delete mode 100644 modules/mogo-module-adas/src/main/java/com/mogo/module/adas/entity/DispatchData.java delete mode 100644 modules/mogo-module-adas/src/main/java/com/mogo/module/adas/entity/DispatchResult.java delete mode 100644 modules/mogo-module-adas/src/main/java/com/mogo/module/adas/entity/EndLatLon.java delete mode 100644 modules/mogo-module-adas/src/main/java/com/mogo/module/adas/entity/ReportDispatchResult.java delete mode 100644 modules/mogo-module-adas/src/main/java/com/mogo/module/adas/entity/ReportedRoute.java delete mode 100644 modules/mogo-module-adas/src/main/java/com/mogo/module/adas/entity/StartLatLon.java delete mode 100644 modules/mogo-module-adas/src/main/java/com/mogo/module/adas/model/IDispatch.java delete mode 100644 modules/mogo-module-adas/src/main/java/com/mogo/module/adas/overlay/LineOverlayManager.java delete mode 100644 modules/mogo-module-adas/src/main/java/com/mogo/module/adas/receiver/TestAdasFuncManager.java delete mode 100644 modules/mogo-module-adas/src/main/java/com/mogo/module/adas/view/DispatchRemindDialog.java delete mode 100644 modules/mogo-module-adas/src/main/res/drawable/module_adas_bg_shape.xml delete mode 100644 modules/mogo-module-adas/src/main/res/drawable/module_adas_left_corner_bg.xml delete mode 100644 modules/mogo-module-adas/src/main/res/drawable/module_adas_right_corner_bg.xml delete mode 100644 modules/mogo-module-adas/src/main/res/drawable/module_adas_timer_bg_shape.xml delete mode 100644 modules/mogo-module-adas/src/main/res/layout/dialog_adas_dispatch_remind.xml diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/DebugSettingView.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/DebugSettingView.kt index 4bb7925d55..d5e6f2d6b1 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/DebugSettingView.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/DebugSettingView.kt @@ -69,10 +69,15 @@ class DebugSettingView @JvmOverloads constructor( override fun onAttachedToWindow() { super.onAttachedToWindow() + // 添加 OBU状态 监听 CallerObuListenerManager.addListener(TAG, this) + // 添加 ADAS状态 监听 CallerAutoPilotStatusListenerManager.addListener(TAG, this) + // 添加 ADAS车辆状态&定位 监听 CallerAutopilotCarStatusListenerManager.addListener(TAG, this) + // 添加 地图样式改变 监听 CallerMapLocationListenerManager.addListener(TAG, this) + // 添加 域控制器感知数据 监听 CallerAutopilotIdentifyListenerManager.addListener(TAG, this) if (logInfoView != null) { logInfoView!!.onEnterForeground() @@ -81,10 +86,15 @@ class DebugSettingView @JvmOverloads constructor( override fun onDetachedFromWindow() { super.onDetachedFromWindow() + // 移除 OBU状态 监听 CallerObuListenerManager.removeListener(TAG) + // 移除 ADAS状态 监听 CallerAutoPilotStatusListenerManager.removeListener(TAG) + // 移除 ADAS车辆状态&定位 监听 CallerAutopilotCarStatusListenerManager.removeListener(TAG) + // 移除 地图样式改变 监听 CallerMapLocationListenerManager.removeListener(TAG) + // 移除 域控制器感知数据 监听 CallerAutopilotIdentifyListenerManager.removeListener(TAG) if (logInfoView != null) { logInfoView!!.onEnterBackground() diff --git a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerAutoPilotStatusListenerManager.kt b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerAutoPilotStatusListenerManager.kt index b76a5ee25f..ca2d1c8abb 100644 --- a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerAutoPilotStatusListenerManager.kt +++ b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerAutoPilotStatusListenerManager.kt @@ -41,7 +41,7 @@ object CallerAutoPilotStatusListenerManager : CallerBase() { } /** - * 添加监听 + * 添加 ADAS状态 监听 * @param tag 标记,用来注销监听使用 * @param listener 监听回调 */ diff --git a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerAutopilotCarStatusListenerManager.kt b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerAutopilotCarStatusListenerManager.kt index 7ab0695921..c4df059436 100644 --- a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerAutopilotCarStatusListenerManager.kt +++ b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerAutopilotCarStatusListenerManager.kt @@ -21,7 +21,7 @@ object CallerAutopilotCarStatusListenerManager : CallerBase() { /** - * 添加监听 + * 添加 ADAS车辆状态&定位 监听 * @param tag 标记,用来注销监听使用 * @param listener 监听回调 */ diff --git a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerAutopilotIdentifyListenerManager.kt b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerAutopilotIdentifyListenerManager.kt index d0c0fa9514..1de733bdf8 100644 --- a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerAutopilotIdentifyListenerManager.kt +++ b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerAutopilotIdentifyListenerManager.kt @@ -23,7 +23,7 @@ object CallerAutopilotIdentifyListenerManager : CallerBase() { ConcurrentHashMap() /** - * 添加监听 + * 添加 域控制器感知数据 监听 * @param tag 标记,用来注销监听使用 * @param listener 监听回调 */ diff --git a/modules/mogo-module-adas/src/main/java/com/mogo/module/adas/AdasAutoPilotManager.java b/modules/mogo-module-adas/src/main/java/com/mogo/module/adas/AdasAutoPilotManager.java deleted file mode 100644 index af4b818045..0000000000 --- a/modules/mogo-module-adas/src/main/java/com/mogo/module/adas/AdasAutoPilotManager.java +++ /dev/null @@ -1,269 +0,0 @@ -package com.mogo.module.adas; - -import static com.mogo.module.adas.AdasConstant.MODULE_TAG; -import static com.mogo.module.adas.entity.DispatchAdasAutoPilotLocReceiverBean.DISPATCH_SOURCE_HENGYANG; -import static com.mogo.module.adas.entity.DispatchAdasAutoPilotLocReceiverBean.DISPATCH_TYPE_START; -import static com.mogo.module.adas.model.AdasServiceModel.DISPATCH_RESULT_AFFIRM; -import static com.mogo.module.adas.model.AdasServiceModel.DISPATCH_RESULT_MANUAL_CANCEL; -import static com.mogo.module.adas.model.AdasServiceModel.DISPATCH_RESULT_TIMER_CANCEL; - -import android.content.Context; -import android.location.Location; -import android.os.Handler; -import android.os.Message; - -import com.mogo.eagle.core.data.autopilot.AutopilotRouteInfo; -import com.mogo.eagle.core.data.autopilot.AutopilotStatusInfo; -import com.mogo.eagle.core.data.map.MogoLatLng; -import com.mogo.eagle.core.data.map.MogoLocation; -import com.mogo.eagle.core.network.utils.GsonUtil; -import com.mogo.eagle.core.utilcode.mogo.logger.Logger; -import com.mogo.map.navi.IMogoCarLocationChangedListener2; -import com.mogo.module.adas.entity.DispatchAdasAutoPilotLocReceiverBean; -import com.mogo.module.adas.entity.DispatchData; -import com.mogo.module.adas.entity.DispatchResult; -import com.mogo.module.adas.entity.EndLatLon; -import com.mogo.module.adas.entity.StartLatLon; -import com.mogo.module.adas.model.AdasServiceModel; -import com.mogo.module.adas.model.IDispatch; -import com.mogo.module.adas.overlay.LineOverlayManager; -import com.mogo.module.adas.view.DispatchRemindDialog; -import com.mogo.module.common.MogoApisHandler; -import com.mogo.service.cloud.socket.IMogoOnMessageListener; -import com.zhidao.support.adas.high.bean.AutopilotRoute; - -import java.util.ArrayList; -import java.util.List; - -//todo 后续拆解是否放到网约车模块,画线部分已与产品沟通,放入后续迭代需求 -//负责监听自动驾驶状态并进行状态上报,自动驾驶路线上报,接收调度指令展示指令弹窗 -public class AdasAutoPilotManager implements IMogoOnMessageListener - , IAdasDataListener - , DispatchRemindDialog.IDispatchRemindClickListener - , IMogoCarLocationChangedListener2 { - - private static final String TAG = "AdasAutoPilotManager"; - private static volatile AdasAutoPilotManager instance; - private static final byte[] obj = new byte[0]; - private Context mContext; - private static final int MSG_SOCKET_TYPE = 501000; - private static final int MSG_TYPE_SHOW_DIALOG = 0; - - private DispatchRemindDialog dispatchRemindDialog; - private LineOverlayManager lineOverlayManager; - private IDispatchResultListener dispatchResultListener; - private DispatchAdasAutoPilotLocReceiverBean receiverBean; - private List latLngList; - private boolean drawLine; - - private AdasAutoPilotManager() { - - } - - public static AdasAutoPilotManager getInstance() { - if (instance == null) { - synchronized (obj) { - if (instance == null) { - instance = new AdasAutoPilotManager(); - } - } - } - return instance; - } - - private final Handler handler = new Handler() { - @Override - public void handleMessage(Message msg) { - super.handleMessage(msg); - if (msg.what == MSG_TYPE_SHOW_DIALOG) { - DispatchAdasAutoPilotLocReceiverBean msgData = (DispatchAdasAutoPilotLocReceiverBean) msg.obj; - dispatchRemindDialog.showDialog(msgData.getEndLocAddress()); - } - } - }; - - public void initSocket(Context context) { - mContext = context; - MogoApisHandler.getInstance() - .getApis() - .getSocketManagerApi(context).registerOnMessageListener(MSG_SOCKET_TYPE, this); - MogoApisHandler.getInstance().getApis().getRegisterCenterApi() - .registerCarLocationChangedListener(MODULE_TAG, this); - AdasEventManager.getInstance().addEventListener(this); - dispatchRemindDialog = new DispatchRemindDialog(context); - dispatchRemindDialog.addIDispatchRemindListener(this); - if (lineOverlayManager == null) { - lineOverlayManager = new LineOverlayManager(mContext); - lineOverlayManager.setIAdasLineOverlayListener(() -> drawLine = false); - } - } - - public void addIDispatchResult(IDispatchResultListener listener) { - this.dispatchResultListener = listener; - } - - @Override - public Class target() { - return DispatchAdasAutoPilotLocReceiverBean.class; - } - - @Override - public void onMsgReceived(DispatchAdasAutoPilotLocReceiverBean adasAutoPilotLocReceiverBean) { - if (adasAutoPilotLocReceiverBean != null - && adasAutoPilotLocReceiverBean.getEndLat() != 0.0 - && adasAutoPilotLocReceiverBean.getEndLon() != 0.0 - && adasAutoPilotLocReceiverBean.getEndLocAddress() != null) { -// if (AdasEventManager.getInstance().getAutopilotValuesStatus() != null && -// AdasEventManager.getInstance().getAutopilotValuesStatus().getPilotmode() == 1) { -// Logger.d(TAG, "onMsgReceived 接收到服务端调度信息,但现在已经在自动驾驶状态,下发重复 略过"); -// return; -// } - if (adasAutoPilotLocReceiverBean.getSource() == DISPATCH_SOURCE_HENGYANG - && adasAutoPilotLocReceiverBean.getType() == DISPATCH_TYPE_START) { - this.receiverBean = adasAutoPilotLocReceiverBean; - Message message = new Message(); - message.what = MSG_TYPE_SHOW_DIALOG; - message.obj = adasAutoPilotLocReceiverBean; - handler.sendMessage(message); - } - } - } - - @Override - public void notifyAutopilotState(AutopilotStatusInfo autopilotStatus) { - AdasServiceModel.getInstance().uploadAutopilotStatus(autopilotStatus); - } - - @Override - public void autopilotRoute(AutopilotRouteInfo autopilotRoute) { -// if (autopilotRoute == null || autopilotRoute.getModels() == null || autopilotRoute.getModels().size() == 0) { -// return; -// } -// AdasServiceModel.getInstance().uploadAutopilotRoute(autopilotRoute.getModels()); -// latLngList = new ArrayList<>(); -// for (AutopilotRoute.RouteModels routeModel : autopilotRoute.getModels()) { -// latLngList.add(new MogoLatLng(routeModel.getLat(), routeModel.getLon())); -// } -// drawLine = true; - } - - @Override - public void affirm() { - AdasServiceModel.getInstance().dispatchResultUpload(DISPATCH_RESULT_AFFIRM, new IDispatch() { - @Override - public void onSuccess() { - Logger.d(TAG, ""); - if (dispatchResultListener != null) { - DispatchResult dispatchResult = new DispatchResult( - new StartLatLon(receiverBean.getStartLat(), receiverBean.getStartLon()), - new EndLatLon(receiverBean.getEndLat(), receiverBean.getEndLon())); - DispatchData dispatchData = new DispatchData("aiCloudToStartAutopilot", dispatchResult); - dispatchResultListener.dispatchAffirm(GsonUtil.jsonFromObject(dispatchData)); - } - } - - @Override - public void onError(String msg) { - - } - }); - } - - @Override - public void cancel(boolean manualTrigger) { - AdasServiceModel.getInstance().dispatchResultUpload(manualTrigger ? - DISPATCH_RESULT_MANUAL_CANCEL : DISPATCH_RESULT_TIMER_CANCEL, new IDispatch() { - @Override - public void onSuccess() { - - } - - @Override - public void onError(String msg) { - - } - }); - } - - @Override - public void onCarLocationChanged2(Location location) { - //坐标转换 - MogoLocation loc = new MogoLocation(); - loc.setTime(loc.getTime()); - loc.setAccuracy(location.getAccuracy()); - loc.setSpeed(location.getSpeed()); - loc.setLongitude(location.getLongitude()); - loc.setLatitude(location.getLatitude()); - loc.setAltitude(location.getAltitude()); - loc.setBearing(location.getBearing()); - loc.setProvider(location.getProvider()); -// if (drawLine) { -// lineOverlayManager.draw(mogoLocation, latLngList); -// } - } - - @Override - public void onCarLocationChanged(MogoLatLng mogoLatLng) { - - } - - /** - * 调度指令结果回调 - */ - public interface IDispatchResultListener { - //调用确认 - void dispatchAffirm(String json); - } - - public void test() { - Logger.d(TAG, "test to trigger mock autopilot"); - DispatchAdasAutoPilotLocReceiverBean adasAutoPilotLocReceiverBean = new DispatchAdasAutoPilotLocReceiverBean( - DISPATCH_SOURCE_HENGYANG, DISPATCH_TYPE_START, "1", - 26.825571122, 112.5762410415, "测试数据", - 26.825571122, 112.5762410415, "调度至衡阳首钢", - "", "", "开始调度", System.currentTimeMillis()); - this.receiverBean = adasAutoPilotLocReceiverBean; - dispatchRemindDialog.showDialog(adasAutoPilotLocReceiverBean.getEndLocAddress()); - } - - public void testNotifyAutopilotState() { - AutopilotStatusInfo autopilotStatus = new AutopilotStatusInfo(); - autopilotStatus.setReason("123"); - autopilotStatus.setSpeed(123); - autopilotStatus.setState(0); - AdasServiceModel.getInstance().uploadAutopilotStatus(autopilotStatus); - } - - public void testUploadAutopilotRoute() { - List list = new ArrayList<>(); - AutopilotRoute.RouteModels routeModels = new AutopilotRoute.RouteModels(); - routeModels.setLat(12.12); - routeModels.setLon(13.14); - list.add(routeModels); - AdasServiceModel.getInstance().uploadAutopilotRoute(list); - } - - public void testDispatchResultUpload() { - AdasServiceModel.getInstance().dispatchResultUpload(DISPATCH_RESULT_AFFIRM, new IDispatch() { - @Override - public void onSuccess() { - - } - - @Override - public void onError(String msg) { - - } - }); - } - - public void testDispatchAutopilot() { - DispatchResult dispatchResult = new DispatchResult( - new StartLatLon(12.12, 13.13), - new EndLatLon(12.12, 13.13)); - DispatchData dispatchData = new DispatchData("aiCloudToStartAutopilot", dispatchResult); - String json = GsonUtil.jsonFromObject(dispatchData); - Logger.d(TAG, "testDispatchAutopilot json : " + json); - } - -} diff --git a/modules/mogo-module-adas/src/main/java/com/mogo/module/adas/AdasEventManager.java b/modules/mogo-module-adas/src/main/java/com/mogo/module/adas/AdasEventManager.java index e14af8f05f..ca28135c4e 100644 --- a/modules/mogo-module-adas/src/main/java/com/mogo/module/adas/AdasEventManager.java +++ b/modules/mogo-module-adas/src/main/java/com/mogo/module/adas/AdasEventManager.java @@ -271,15 +271,7 @@ public class AdasEventManager implements @Override public void onAutopilotRotting(@Nullable AutopilotRouteInfo autopilotRoute) { - if (autopilotRoute.getModels() == null || autopilotRoute.getModels().size() == 0) { - Logger.d(TAG, "onAutopilotRoute is null !"); - return; - } - for (IAdasDataListener listener : iAdasEventListeners) { - if (listener != null) { - listener.autopilotRoute(autopilotRoute); - } - } + } @Override diff --git a/modules/mogo-module-adas/src/main/java/com/mogo/module/adas/IAdasDataListener.java b/modules/mogo-module-adas/src/main/java/com/mogo/module/adas/IAdasDataListener.java index b2867aebe8..3235dfcb4e 100644 --- a/modules/mogo-module-adas/src/main/java/com/mogo/module/adas/IAdasDataListener.java +++ b/modules/mogo-module-adas/src/main/java/com/mogo/module/adas/IAdasDataListener.java @@ -30,15 +30,6 @@ public interface IAdasDataListener { default void autopilotArrive(AutopilotStationInfo autopilotWayArrive) { } - /** - * 自动驾驶路线回调 - * - * @param autopilotRoute {@link AutopilotRouteInfo} - */ - default void autopilotRoute(AutopilotRouteInfo autopilotRoute) { - - } - /** * 自车定位信息 * diff --git a/modules/mogo-module-adas/src/main/java/com/mogo/module/adas/entity/DispatchAdasAutoPilotLocReceiverBean.java b/modules/mogo-module-adas/src/main/java/com/mogo/module/adas/entity/DispatchAdasAutoPilotLocReceiverBean.java deleted file mode 100644 index 9350649c87..0000000000 --- a/modules/mogo-module-adas/src/main/java/com/mogo/module/adas/entity/DispatchAdasAutoPilotLocReceiverBean.java +++ /dev/null @@ -1,165 +0,0 @@ -package com.mogo.module.adas.entity; - -public class DispatchAdasAutoPilotLocReceiverBean { - - public static final int DISPATCH_SOURCE_HENGYANG = 1; - public static final int DISPATCH_SOURCE_EZHOU = 2; - public static final int DISPATCH_TYPE_START = 1; - public static final int DISPATCH_TYPE_STOP = 2; - - private int source; // 1:衡阳 2:鄂州 - private int type; // 1:启动 2:停止 - private String poiId; - - private double startLat; - private double startLon; - private String startLocAddress; - - private double endLat; - private double endLon; - private String endLocAddress; - - private String taskTime; - private String flightInfo; - private String taskInfo; - private long systemTime; - - public DispatchAdasAutoPilotLocReceiverBean(int source, int type, String poiId, double startLat, double startLon, String startLocAddress, double endLat, double endLon, String endLocAddress, String taskTime, String flightInfo, String taskInfo, long systemTime) { - this.source = source; - this.type = type; - this.poiId = poiId; - this.startLat = startLat; - this.startLon = startLon; - this.startLocAddress = startLocAddress; - this.endLat = endLat; - this.endLon = endLon; - this.endLocAddress = endLocAddress; - this.taskTime = taskTime; - this.flightInfo = flightInfo; - this.taskInfo = taskInfo; - this.systemTime = systemTime; - } - - public int getSource() { - return source; - } - - public void setSource(int source) { - this.source = source; - } - - public int getType() { - return type; - } - - public void setType(int type) { - this.type = type; - } - - public String getPoiId() { - return poiId; - } - - public void setPoiId(String poiId) { - this.poiId = poiId; - } - - public double getStartLat() { - return startLat; - } - - public void setStartLat(double startLat) { - this.startLat = startLat; - } - - public double getStartLon() { - return startLon; - } - - public void setStartLon(double startLon) { - this.startLon = startLon; - } - - public String getStartLocAddress() { - return startLocAddress; - } - - public void setStartLocAddress(String startLocAddress) { - this.startLocAddress = startLocAddress; - } - - public double getEndLat() { - return endLat; - } - - public void setEndLat(double endLat) { - this.endLat = endLat; - } - - public double getEndLon() { - return endLon; - } - - public void setEndLon(double endLon) { - this.endLon = endLon; - } - - public String getEndLocAddress() { - return endLocAddress; - } - - public void setEndLocAddress(String endLocAddress) { - this.endLocAddress = endLocAddress; - } - - public String getTaskTime() { - return taskTime; - } - - public void setTaskTime(String taskTime) { - this.taskTime = taskTime; - } - - public String getFlightInfo() { - return flightInfo; - } - - public void setFlightInfo(String flightInfo) { - this.flightInfo = flightInfo; - } - - public String getTaskInfo() { - return taskInfo; - } - - public void setTaskInfo(String taskInfo) { - this.taskInfo = taskInfo; - } - - public long getSystemTime() { - return systemTime; - } - - public void setSystemTime(long systemTime) { - this.systemTime = systemTime; - } - - @Override - public String toString() { - return "DispatchAdasAutoPilotLocReceiverBean{" + - "source=" + source + - ", type=" + type + - ", poiId='" + poiId + '\'' + - ", startLat=" + startLat + - ", startLon=" + startLon + - ", startLocAddress='" + startLocAddress + '\'' + - ", endLat=" + endLat + - ", endLon=" + endLon + - ", endLocAddress='" + endLocAddress + '\'' + - ", taskTime='" + taskTime + '\'' + - ", flightInfo='" + flightInfo + '\'' + - ", taskInfo='" + taskInfo + '\'' + - ", systemTime=" + systemTime + - '}'; - } -} diff --git a/modules/mogo-module-adas/src/main/java/com/mogo/module/adas/entity/DispatchData.java b/modules/mogo-module-adas/src/main/java/com/mogo/module/adas/entity/DispatchData.java deleted file mode 100644 index ac89f2e446..0000000000 --- a/modules/mogo-module-adas/src/main/java/com/mogo/module/adas/entity/DispatchData.java +++ /dev/null @@ -1,36 +0,0 @@ -package com.mogo.module.adas.entity; - -public class DispatchData { - - private String action; - private DispatchResult result; - - public DispatchData(String action, DispatchResult result) { - this.action = action; - this.result = result; - } - - public String getAction() { - return action; - } - - public void setAction(String action) { - this.action = action; - } - - public DispatchResult getResult() { - return result; - } - - public void setResult(DispatchResult result) { - this.result = result; - } - - @Override - public String toString() { - return "DispatchData{" + - "action='" + action + '\'' + - ", result=" + result + - '}'; - } -} diff --git a/modules/mogo-module-adas/src/main/java/com/mogo/module/adas/entity/DispatchResult.java b/modules/mogo-module-adas/src/main/java/com/mogo/module/adas/entity/DispatchResult.java deleted file mode 100644 index 99ad342e7a..0000000000 --- a/modules/mogo-module-adas/src/main/java/com/mogo/module/adas/entity/DispatchResult.java +++ /dev/null @@ -1,36 +0,0 @@ -package com.mogo.module.adas.entity; - -public class DispatchResult { - - private StartLatLon startLatLon; - private EndLatLon endLatLon; - - public DispatchResult(StartLatLon startLatLon, EndLatLon endLatLon) { - this.startLatLon = startLatLon; - this.endLatLon = endLatLon; - } - - public StartLatLon getStartLatLon() { - return startLatLon; - } - - public void setStartLatLon(StartLatLon startLatLon) { - this.startLatLon = startLatLon; - } - - public EndLatLon getEndLatLon() { - return endLatLon; - } - - public void setEndLatLon(EndLatLon endLatLon) { - this.endLatLon = endLatLon; - } - - @Override - public String toString() { - return "DispatchResult{" + - "startLatLon=" + startLatLon + - ", endLatLon=" + endLatLon + - '}'; - } -} diff --git a/modules/mogo-module-adas/src/main/java/com/mogo/module/adas/entity/EndLatLon.java b/modules/mogo-module-adas/src/main/java/com/mogo/module/adas/entity/EndLatLon.java deleted file mode 100644 index c30b4ead5b..0000000000 --- a/modules/mogo-module-adas/src/main/java/com/mogo/module/adas/entity/EndLatLon.java +++ /dev/null @@ -1,36 +0,0 @@ -package com.mogo.module.adas.entity; - -public class EndLatLon { - - private double lat; - private double lon; - - public EndLatLon(double lat, double lon) { - this.lat = lat; - this.lon = lon; - } - - 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; - } - - @Override - public String toString() { - return "EndLatLon{" + - "lat=" + lat + - ", lon=" + lon + - '}'; - } -} diff --git a/modules/mogo-module-adas/src/main/java/com/mogo/module/adas/entity/ReportDispatchResult.java b/modules/mogo-module-adas/src/main/java/com/mogo/module/adas/entity/ReportDispatchResult.java deleted file mode 100644 index b124381df5..0000000000 --- a/modules/mogo-module-adas/src/main/java/com/mogo/module/adas/entity/ReportDispatchResult.java +++ /dev/null @@ -1,36 +0,0 @@ -package com.mogo.module.adas.entity; - -public class ReportDispatchResult { - - private String sn; - private int dispatchResult; - - public ReportDispatchResult(String sn, int dispatchResult) { - this.sn = sn; - this.dispatchResult = dispatchResult; - } - - public String getSn() { - return sn; - } - - public void setSn(String sn) { - this.sn = sn; - } - - public int getDispatchResult() { - return dispatchResult; - } - - public void setDispatchResult(int dispatchResult) { - this.dispatchResult = dispatchResult; - } - - @Override - public String toString() { - return "ReportDispatchResult{" + - "sn='" + sn + '\'' + - ", dispatchResult=" + dispatchResult + - '}'; - } -} diff --git a/modules/mogo-module-adas/src/main/java/com/mogo/module/adas/entity/ReportedRoute.java b/modules/mogo-module-adas/src/main/java/com/mogo/module/adas/entity/ReportedRoute.java deleted file mode 100644 index 8fc5663dce..0000000000 --- a/modules/mogo-module-adas/src/main/java/com/mogo/module/adas/entity/ReportedRoute.java +++ /dev/null @@ -1,38 +0,0 @@ -package com.mogo.module.adas.entity; - - -import com.mogo.eagle.core.data.autopilot.AutopilotStatusInfo; - -/** - * 上报自动驾驶规划的路径 - */ -public class ReportedRoute { - private String sn; - private AutopilotStatusInfo bean; - private String siteList; - - public ReportedRoute(String sn, AutopilotStatusInfo bean) { - this.sn = sn; - this.bean = bean; - } - - public ReportedRoute(String sn, String siteList) { - this.sn = sn; - this.siteList = siteList; - } - - public String getSiteList() { - return siteList; - } - - public String getState() { - return "{\"sn\":\"" + sn + "\",\"state\":" + bean.getState() + ",\"speed\":" + bean.getSpeed() + ",\"reason\":\"" + bean.getReason() + "\",\"camera\":" + bean.getCamera() + ",\"radar\":" + bean.getRadar() + ",\"rtk\":" + bean.getRtk() + "}"; - } - - public String getRoute() { - return "{\"sn\":\"" + sn + "\",\"siteList\":" + siteList + "}"; - - } - - -} diff --git a/modules/mogo-module-adas/src/main/java/com/mogo/module/adas/entity/StartLatLon.java b/modules/mogo-module-adas/src/main/java/com/mogo/module/adas/entity/StartLatLon.java deleted file mode 100644 index 2038c5ff2f..0000000000 --- a/modules/mogo-module-adas/src/main/java/com/mogo/module/adas/entity/StartLatLon.java +++ /dev/null @@ -1,36 +0,0 @@ -package com.mogo.module.adas.entity; - -public class StartLatLon { - - private double lat; - private double lon; - - public StartLatLon(double lat, double lon) { - this.lat = lat; - this.lon = lon; - } - - 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; - } - - @Override - public String toString() { - return "StartLatLon{" + - "lat=" + lat + - ", lon=" + lon + - '}'; - } -} diff --git a/modules/mogo-module-adas/src/main/java/com/mogo/module/adas/model/AdasServiceModel.java b/modules/mogo-module-adas/src/main/java/com/mogo/module/adas/model/AdasServiceModel.java index 93e7341332..31553c43b3 100644 --- a/modules/mogo-module-adas/src/main/java/com/mogo/module/adas/model/AdasServiceModel.java +++ b/modules/mogo-module-adas/src/main/java/com/mogo/module/adas/model/AdasServiceModel.java @@ -2,23 +2,14 @@ package com.mogo.module.adas.model; import com.mogo.cloud.passport.MoGoAiCloudClientConfig; import com.mogo.eagle.core.data.BaseData; -import com.mogo.eagle.core.data.autopilot.AutopilotStatusInfo; import com.mogo.eagle.core.network.RequestOptions; import com.mogo.eagle.core.network.SubscribeImpl; import com.mogo.eagle.core.network.utils.GsonUtil; import com.mogo.eagle.core.utilcode.mogo.logger.Logger; import com.mogo.module.adas.entity.AutonomousDriveStatusBean; -import com.mogo.module.adas.entity.ReportDispatchResult; import com.mogo.module.adas.entity.ReportSiteBean; -import com.mogo.module.adas.entity.ReportedRoute; import com.mogo.module.adas.network.IAdasApiService; import com.mogo.module.common.MogoApisHandler; -import com.zhidao.support.adas.high.bean.AutopilotRoute; -import com.zhidao.support.adas.high.bean.AutopilotStatus; - -import java.util.HashMap; -import java.util.List; -import java.util.Map; import io.reactivex.android.schedulers.AndroidSchedulers; import io.reactivex.schedulers.Schedulers; @@ -34,10 +25,6 @@ public class AdasServiceModel { private static volatile AdasServiceModel instance; private static final byte[] obj = new byte[0]; - public static final int DISPATCH_RESULT_AFFIRM = 0; - public static final int DISPATCH_RESULT_MANUAL_CANCEL = 1; - public static final int DISPATCH_RESULT_TIMER_CANCEL = 2; - private final IAdasApiService mAdasApiService; private AdasServiceModel() { @@ -55,110 +42,6 @@ public class AdasServiceModel { return instance; } - /** - * 上报自动驾驶状态 - * - * @param autopilotStatus {@link AutopilotStatus} - */ - public void uploadAutopilotStatus(AutopilotStatusInfo autopilotStatus) { - String sn = MoGoAiCloudClientConfig.getInstance().getSn(); - ReportedRoute reportedRoute = new ReportedRoute(sn, autopilotStatus); - Map map = new HashMap<>(); - map.put("sn", sn); - map.put("data", GsonUtil.jsonFromObject(reportedRoute)); - mAdasApiService.uploadAutopilotState(map) - .subscribeOn(Schedulers.io()) - .observeOn(AndroidSchedulers.mainThread()) - .subscribe(new SubscribeImpl(RequestOptions.create(getContext())) { - @Override - public void onNext(BaseData o) { - super.onNext(o); - Logger.d(TAG, "uploadAutopilotStatus success"); - } - - @Override - public void onError(Throwable e) { - super.onError(e); - Logger.d(TAG, "uploadAutopilotStatus error : " + e.getMessage()); - } - - @Override - public void onSuccess(BaseData o) { - super.onSuccess(o); - } - }); - } - - /** - * 上报自动驾驶路线 - * - * @param list 路线集合 - */ - public void uploadAutopilotRoute(List list) { - String sn = MoGoAiCloudClientConfig.getInstance().getSn(); - ReportedRoute reportedRoute = new ReportedRoute(sn, GsonUtil.jsonFromObject(list)); - Map map = new HashMap<>(); - map.put("sn", sn); - map.put("data", GsonUtil.jsonFromObject(reportedRoute)); - mAdasApiService.uploadAutopilotRoute(map) - .subscribeOn(Schedulers.io()) - .observeOn(AndroidSchedulers.mainThread()) - .subscribe(new SubscribeImpl(RequestOptions.create(getContext())) { - @Override - public void onNext(BaseData o) { - super.onNext(o); - Logger.d(TAG, "uploadAutopilotRoute success"); - } - - @Override - public void onError(Throwable e) { - super.onError(e); - Logger.d(TAG, "uploadAutopilotRoute error : " + e.getMessage()); - } - - @Override - public void onSuccess(BaseData o) { - super.onSuccess(o); - } - }); - } - - /** - * 上报调度处理结果 - * - * @param dispatchResultType int - */ - public void dispatchResultUpload(int dispatchResultType, IDispatch dispatch) { - String sn = MoGoAiCloudClientConfig.getInstance().getSn(); - ReportDispatchResult reportDispatchResult = new ReportDispatchResult(sn, dispatchResultType); - Map map = new HashMap<>(); - map.put("sn", sn); - map.put("data", GsonUtil.jsonFromObject(reportDispatchResult)); - mAdasApiService.uploadDispatchResult(map) - .subscribeOn(Schedulers.io()) - .observeOn(AndroidSchedulers.mainThread()) - .subscribe(new SubscribeImpl(RequestOptions.create(getContext())) { - @Override - public void onNext(BaseData o) { - super.onNext(o); - Logger.d(TAG, "dispatchResultUpload success"); - dispatch.onSuccess(); - } - - @Override - public void onError(Throwable e) { - super.onError(e); - Logger.d(TAG, "dispatchResultUpload error : " + e.getMessage()); - dispatch.onError(e.getMessage()); - } - - @Override - public void onSuccess(BaseData o) { - super.onSuccess(o); - } - }); - } - public void updateDriveStatus(int autoPilotStatus, float autoPilotSpeed) { String sn = MoGoAiCloudClientConfig.getInstance().getSn(); AutonomousDriveStatusBean request = new AutonomousDriveStatusBean(sn, autoPilotStatus, autoPilotSpeed); @@ -184,7 +67,7 @@ public class AdasServiceModel { }); } - public void reportSite(double lon, double lat){ + public 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)); diff --git a/modules/mogo-module-adas/src/main/java/com/mogo/module/adas/model/IDispatch.java b/modules/mogo-module-adas/src/main/java/com/mogo/module/adas/model/IDispatch.java deleted file mode 100644 index 41f896bd22..0000000000 --- a/modules/mogo-module-adas/src/main/java/com/mogo/module/adas/model/IDispatch.java +++ /dev/null @@ -1,8 +0,0 @@ -package com.mogo.module.adas.model; - -public interface IDispatch { - - void onSuccess(); - - void onError(String msg); -} diff --git a/modules/mogo-module-adas/src/main/java/com/mogo/module/adas/network/IAdasApiService.java b/modules/mogo-module-adas/src/main/java/com/mogo/module/adas/network/IAdasApiService.java index 4cf15f5980..e3fe324cfb 100644 --- a/modules/mogo-module-adas/src/main/java/com/mogo/module/adas/network/IAdasApiService.java +++ b/modules/mogo-module-adas/src/main/java/com/mogo/module/adas/network/IAdasApiService.java @@ -2,55 +2,30 @@ package com.mogo.module.adas.network; import com.mogo.eagle.core.data.BaseData; -import java.util.Map; - import io.reactivex.Observable; import okhttp3.RequestBody; import retrofit2.http.Body; -import retrofit2.http.FieldMap; -import retrofit2.http.FormUrlEncoded; import retrofit2.http.Headers; import retrofit2.http.POST; public interface IAdasApiService { - //上传自动驾驶状态接口 + /** + * 上传自动驾驶状态接口 + * @param requestBody + * @return + */ @Headers({"Content-Type:application/json;charset=UTF-8"}) @POST("/dataService/autonomousDrive/updateAutonomousDriveStatus") Observable updateAutonomousDriveStatus(@Body RequestBody requestBody); - //站点上报 用于网约车业务 + /** + * 站点上报 用于网约车业务 云平台绘制路线使用 + * @param requestBody + * @return + */ @Headers({"Content-Type:application/json;charset=UTF-8"}) @POST("/dataService/autonomousDrive/reportSite") Observable updateReportSite(@Body RequestBody requestBody); - /** - * 上报自动驾驶状态 服务于业务调度 - * - * @param parameters map - * @return {@link BaseData} - */ - @FormUrlEncoded - @POST("/dataService/autoDriver/receiveAutopilotState") - Observable uploadAutopilotState(@FieldMap Map parameters); - - /** - * 上报自动驾驶路径 服务于业务调度 - * - * @param parameters map - * @return {@link BaseData} - */ - @FormUrlEncoded - @POST("/dataService/autoDriver/receiveCarPreSetPath") - Observable uploadAutopilotRoute(@FieldMap Map parameters); - - /** - * 上报自动驾驶调度处理结果 服务于业务调度 - * - * @param parameters map - * @return {@link BaseData} - */ - @FormUrlEncoded - @POST("/dataService/autoDriver/receiverDestSiteResult") - Observable uploadDispatchResult(@FieldMap Map parameters); } diff --git a/modules/mogo-module-adas/src/main/java/com/mogo/module/adas/overlay/LineOverlayManager.java b/modules/mogo-module-adas/src/main/java/com/mogo/module/adas/overlay/LineOverlayManager.java deleted file mode 100644 index 87576b677a..0000000000 --- a/modules/mogo-module-adas/src/main/java/com/mogo/module/adas/overlay/LineOverlayManager.java +++ /dev/null @@ -1,90 +0,0 @@ -package com.mogo.module.adas.overlay; - -import android.content.Context; - -import com.mogo.eagle.core.data.map.MogoLatLng; -import com.mogo.eagle.core.data.map.MogoLocation; -import com.mogo.eagle.core.network.utils.GsonUtil; -import com.mogo.eagle.core.utilcode.mogo.logger.Logger; -import com.mogo.eagle.core.utilcode.util.ColorUtils; -import com.mogo.map.overlay.IMogoOverlayManager; -import com.mogo.map.overlay.IMogoPolyline; -import com.mogo.map.overlay.MogoPolylineOptions; -import com.mogo.module.common.MogoApisHandler; - -import java.util.ArrayList; -import java.util.List; - -public class LineOverlayManager { - - private static final String TAG = "LineOverlayManager"; - private IMogoPolyline mMoGoPolyline; - // 连接线参数 - private MogoPolylineOptions mPolylineOptions; - // 线路径集合 - private List mPolylinePointList; - // 渐变色 - private List mPolylineColors; - - IMogoOverlayManager mogoOverlayManager; - - private Context mContext; - - private IAdasLineOverlayListener lineOverlayListener; - - public LineOverlayManager(Context context) { - mPolylineOptions = new MogoPolylineOptions(); - // 绘制路径集合 - mPolylinePointList = new ArrayList<>(); - // 引导线颜色 - mPolylineColors = new ArrayList<>(); - mContext = context; - mogoOverlayManager = MogoApisHandler.getInstance().getApis().getMapServiceApi().getOverlayManager(mContext); - } - - public void setIAdasLineOverlayListener(IAdasLineOverlayListener listener){ - this.lineOverlayListener = listener; - } - - /** - * 绘制最优路线 - * - * @param polylinePoint 要绘制的经纬度度集合 - */ - public void draw(MogoLocation carLocal, List polylinePoint) { - Logger.d(TAG,"ready to draw"); - if (mMoGoPolyline != null) { - mMoGoPolyline.remove(); - mPolylinePointList.clear(); - mPolylineColors.clear(); - } - if (polylinePoint != null) { - Logger.d(TAG,"draw"); - // 将当前车辆位置放进去 - // 过滤后台推送的推荐路线集合 - for (MogoLatLng polyline : polylinePoint) { - //需要剔除已经行驶过的经纬度,这里需要比对推荐路线集合中的点是否在当前车辆行驶方向前面如果不在则抛弃 -// if (LocationUtils.isPointOnCarFront(carLocal, polyline)) { - mPolylinePointList.add(polyline); -// } - } - if(mPolylinePointList.size() < 2 && lineOverlayListener != null){ - Logger.d(TAG,"finish line"); - lineOverlayListener.finishLine(); - } - Logger.d(TAG,"point list size : " + mPolylinePointList.size() + " json : " + GsonUtil.jsonFromObject(mPolylinePointList)); - mPolylineColors.addAll(ColorUtils.getGradientAlpha("#002965ED", "#FF2965ED", "#002965ED", mPolylinePointList.size())); - // 替换路径集合 - mPolylineOptions.setGps(true); - mPolylineOptions.points(mPolylinePointList); - // 线条粗细,渐变,渐变色值 - mPolylineOptions.width(25).useGradient(true).colorValues(mPolylineColors); - // 绘制线 - mMoGoPolyline = mogoOverlayManager.addPolyline(mPolylineOptions); - } - } - - public interface IAdasLineOverlayListener{ - void finishLine(); - } -} diff --git a/modules/mogo-module-adas/src/main/java/com/mogo/module/adas/receiver/AdasTestPanelBroadCastReceiver.java b/modules/mogo-module-adas/src/main/java/com/mogo/module/adas/receiver/AdasTestPanelBroadCastReceiver.java index cfd5fba97b..c5f658b4b4 100644 --- a/modules/mogo-module-adas/src/main/java/com/mogo/module/adas/receiver/AdasTestPanelBroadCastReceiver.java +++ b/modules/mogo-module-adas/src/main/java/com/mogo/module/adas/receiver/AdasTestPanelBroadCastReceiver.java @@ -6,7 +6,6 @@ import android.content.Intent; import com.alibaba.android.arouter.launcher.ARouter; import com.mogo.eagle.core.utilcode.mogo.logger.Logger; -import com.mogo.module.adas.AdasAutoPilotManager; import com.mogo.module.adas.AdasProvider; public class AdasTestPanelBroadCastReceiver extends BroadcastReceiver { @@ -40,19 +39,7 @@ public class AdasTestPanelBroadCastReceiver extends BroadcastReceiver { */ private void dispatchSceneTest(int sceneType) { Logger.d(TAG, "sceneType=" + sceneType); - if (sceneType == 0) {//打开调度弹窗 - AdasAutoPilotManager.getInstance().test(); - } else if(sceneType == 1){ //验证自动驾驶状态上报接口 - AdasAutoPilotManager.getInstance().testNotifyAutopilotState(); - } else if(sceneType == 2){ //验证自动驾驶路线上报接口 - AdasAutoPilotManager.getInstance().testUploadAutopilotRoute(); - } else if(sceneType == 3){ //验证自动驾驶调度上报接口 - AdasAutoPilotManager.getInstance().testDispatchResultUpload(); - } else if(sceneType == 4){ //验证下发给自动驾驶的调用数据 - AdasAutoPilotManager.getInstance().testDispatchAutopilot(); - } else if(sceneType == 5){ //验证画线功能 - TestAdasFuncManager.getInstance().testAddPolyLine(); - } else if(sceneType == 6){ //测试发送sn + if(sceneType == 6){ //测试发送sn AdasProvider adasProvider = ARouter.getInstance().navigation(AdasProvider.class); adasProvider.setBasicInfo(); } diff --git a/modules/mogo-module-adas/src/main/java/com/mogo/module/adas/receiver/TestAdasFuncManager.java b/modules/mogo-module-adas/src/main/java/com/mogo/module/adas/receiver/TestAdasFuncManager.java deleted file mode 100644 index 6742130900..0000000000 --- a/modules/mogo-module-adas/src/main/java/com/mogo/module/adas/receiver/TestAdasFuncManager.java +++ /dev/null @@ -1,75 +0,0 @@ -package com.mogo.module.adas.receiver; - -import com.mogo.commons.AbsMogoApplication; -import com.mogo.eagle.core.data.map.MogoLatLng; -import com.mogo.eagle.core.data.map.MogoLocation; -import com.mogo.eagle.core.network.utils.GsonUtil; -import com.mogo.eagle.core.utilcode.mogo.logger.Logger; -import com.mogo.module.adas.overlay.LineOverlayManager; -import com.mogo.module.common.MogoApisHandler; - -import org.json.JSONObject; - -import java.io.BufferedReader; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.util.ArrayList; -import java.util.List; - -public class TestAdasFuncManager { - - private static final String TAG = "TestAdasFuncManager"; - private static volatile TestAdasFuncManager manager; - private static final byte[] obj = new byte[0]; - - public TestAdasFuncManager() { - - } - - public static TestAdasFuncManager getInstance() { - if (manager == null) { - synchronized (obj) { - if (manager == null) { - manager = new TestAdasFuncManager(); - } - } - } - return manager; - } - - public void testAddPolyLine() { - InputStream is = null; - try { - is = AbsMogoApplication.getApp().getApplicationContext().getAssets().open("testFile.txt"); - BufferedReader br = new BufferedReader(new InputStreamReader(is)); - String line = ""; - List vals = new ArrayList<>(); - while ((line = br.readLine()) != null) { - String json = line.substring(0, line.length() - 1); - MogoLatLng si = GsonUtil.objectFromJson(json, MogoLatLng.class); - vals.add(si); - } - Logger.d(TAG, "mogoLatLon size : " + GsonUtil.jsonFromObject(vals)); - JSONObject data = new JSONObject(); - double lon = 112.57748204198309; - double lat = 26.820175208327566; - data.putOpt("lon", lon); - data.putOpt("lat", lat); - data.putOpt("alt", 0); - data.putOpt("speed", 0); - data.putOpt("satelliteTime", System.currentTimeMillis()); - data.putOpt("heading", 240); - data.putOpt("acceleration", 0); - data.putOpt("yawRate", 0); - MogoApisHandler.getInstance().getApis().getMapServiceApi().getMapUIController().syncLocation2Map(data); - LineOverlayManager lineOverlayManager = new LineOverlayManager(AbsMogoApplication.getApp().getApplicationContext()); - MogoLocation mogoLocation = new MogoLocation(); - mogoLocation.setLongitude(lon); - mogoLocation.setLatitude(lat); - lineOverlayManager.draw(mogoLocation, vals); - } catch (Exception e) { - e.printStackTrace(); - } - - } -} diff --git a/modules/mogo-module-adas/src/main/java/com/mogo/module/adas/view/DispatchRemindDialog.java b/modules/mogo-module-adas/src/main/java/com/mogo/module/adas/view/DispatchRemindDialog.java deleted file mode 100644 index 43a959a7eb..0000000000 --- a/modules/mogo-module-adas/src/main/java/com/mogo/module/adas/view/DispatchRemindDialog.java +++ /dev/null @@ -1,99 +0,0 @@ -package com.mogo.module.adas.view; - -import android.content.Context; -import android.os.Handler; -import android.os.Message; -import android.widget.Button; -import android.widget.TextView; - -import androidx.annotation.NonNull; - -import com.mogo.eagle.core.utilcode.mogo.logger.Logger; -import com.mogo.module.adas.R; -import com.mogo.module.common.dialog.BaseFloatDialog; - - -public class DispatchRemindDialog extends BaseFloatDialog { - - private static final String TAG = "DispatchRemindDialog"; - private static final int MSG_TYPE_TIMER = 0; - private static int TIMER = 10; - private IDispatchRemindClickListener mListener; - - private final TextView tvTimer; - private final TextView tvLoc; - - private Handler handler = new Handler() { - @Override - public void handleMessage(Message msg) { - super.handleMessage(msg); - if (msg.what == MSG_TYPE_TIMER) { - if (TIMER > 0) { - TIMER--; - Logger.d(TAG,"timer : " + TIMER); - tvTimer.setText(String.valueOf(TIMER)); - handler.sendEmptyMessageDelayed(MSG_TYPE_TIMER,1000L); - } else { - hideDialog(); - } - } - } - }; - - public DispatchRemindDialog(@NonNull Context context) { - super(context); - setContentView(R.layout.dialog_adas_dispatch_remind); - setCanceledOnTouchOutside(false); - tvTimer = findViewById(R.id.module_adas_dispatch_remind_timer); - tvLoc = findViewById(R.id.module_adas_dispatch_remind_loc); - Button btnAffirm = (Button) findViewById(R.id.module_adas_dispatch_remind_affirm); - Button btnCancel = (Button) findViewById(R.id.module_adas_dispatch_remind_cancel); - tvTimer.setText(String.valueOf(TIMER)); - btnAffirm.setOnClickListener(v -> { - if (mListener != null) { - mListener.affirm(); - dismissDialog(); - } - }); - btnCancel.setOnClickListener(v -> { - if (mListener != null) { - mListener.cancel(true); - dismissDialog(); - } - }); - } - - public void showDialog(String locContent) { - show(); - handler.sendEmptyMessage(MSG_TYPE_TIMER); - tvLoc.setText(locContent); - } - - private void hideDialog() { - if (mListener != null) { - mListener.cancel(false); - } - dismissDialog(); - } - - private void dismissDialog(){ - handler.removeMessages(MSG_TYPE_TIMER); - TIMER = 10; - dismiss(); - } - - public void addIDispatchRemindListener(IDispatchRemindClickListener listener) { - if (listener == null) { - Logger.d(TAG, "addIDispatchRemindListener listener is null"); - return; - } - this.mListener = listener; - } - - public interface IDispatchRemindClickListener { - - void affirm(); - - void cancel(boolean manualTrigger); - } -} diff --git a/modules/mogo-module-adas/src/main/res/drawable/module_adas_bg_shape.xml b/modules/mogo-module-adas/src/main/res/drawable/module_adas_bg_shape.xml deleted file mode 100644 index 49d2188a32..0000000000 --- a/modules/mogo-module-adas/src/main/res/drawable/module_adas_bg_shape.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/modules/mogo-module-adas/src/main/res/drawable/module_adas_left_corner_bg.xml b/modules/mogo-module-adas/src/main/res/drawable/module_adas_left_corner_bg.xml deleted file mode 100644 index 53c3ce246e..0000000000 --- a/modules/mogo-module-adas/src/main/res/drawable/module_adas_left_corner_bg.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - \ No newline at end of file diff --git a/modules/mogo-module-adas/src/main/res/drawable/module_adas_right_corner_bg.xml b/modules/mogo-module-adas/src/main/res/drawable/module_adas_right_corner_bg.xml deleted file mode 100644 index dcb069b238..0000000000 --- a/modules/mogo-module-adas/src/main/res/drawable/module_adas_right_corner_bg.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - \ No newline at end of file diff --git a/modules/mogo-module-adas/src/main/res/drawable/module_adas_timer_bg_shape.xml b/modules/mogo-module-adas/src/main/res/drawable/module_adas_timer_bg_shape.xml deleted file mode 100644 index 105edfe4de..0000000000 --- a/modules/mogo-module-adas/src/main/res/drawable/module_adas_timer_bg_shape.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/modules/mogo-module-adas/src/main/res/layout/dialog_adas_dispatch_remind.xml b/modules/mogo-module-adas/src/main/res/layout/dialog_adas_dispatch_remind.xml deleted file mode 100644 index 9051de90f7..0000000000 --- a/modules/mogo-module-adas/src/main/res/layout/dialog_adas_dispatch_remind.xml +++ /dev/null @@ -1,95 +0,0 @@ - - - - - - - - - - - - - -