From 4381a006b001b0ecffb8899afdb4468656efabb5 Mon Sep 17 00:00:00 2001 From: wangmingjun Date: Wed, 15 Feb 2023 10:56:00 +0800 Subject: [PATCH] =?UTF-8?q?[M2]=20shuttle=E9=80=82=E9=85=8D=E7=A7=81?= =?UTF-8?q?=E6=9C=89=E5=8C=96=E5=92=8C3.0=E6=9E=B6=E6=9E=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/mogo/och/bus/model/OrderModel.java | 42 ++++++++++--------- .../module/biz/constant/OchCommonConst.kt | 2 +- app/productFlavors/fOchShuttle.gradle | 3 +- app/urlConfig.json | 6 +-- 4 files changed, 28 insertions(+), 25 deletions(-) diff --git a/OCH/mogo-och-bus/src/shuttle/java/com/mogo/och/bus/model/OrderModel.java b/OCH/mogo-och-bus/src/shuttle/java/com/mogo/och/bus/model/OrderModel.java index cf7b3000b2..e08a42244d 100644 --- a/OCH/mogo-och-bus/src/shuttle/java/com/mogo/och/bus/model/OrderModel.java +++ b/OCH/mogo-och-bus/src/shuttle/java/com/mogo/och/bus/model/OrderModel.java @@ -24,15 +24,15 @@ import com.mogo.commons.module.status.StatusDescriptor; import com.mogo.eagle.core.data.BaseData; import com.mogo.eagle.core.data.autopilot.AutopilotControlParameters; import com.mogo.eagle.core.data.config.FunctionBuildConfig; +import com.mogo.eagle.core.data.map.MogoLocation; import com.mogo.eagle.core.data.telematic.TelematicConstant; import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener; import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationGCJ02Listener; import com.mogo.eagle.core.function.api.autopilot.IMoGoPlanningRottingListener; -import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager; +import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager; import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager; -import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ20ListenerManager; +import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ02ListenerManager; import com.mogo.eagle.core.function.call.autopilot.CallerPlanningRottingListenerManager; -import com.mogo.eagle.core.function.call.map.CallerMapLocationListenerManager; import com.mogo.eagle.core.function.call.telematic.CallerTelematicManager; import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger; import com.mogo.eagle.core.utilcode.util.GsonUtils; @@ -154,7 +154,8 @@ public class OrderModel { mContext = AbsMogoApplication.getApp(); loginService = (LoginService) ARouter.getInstance().build(OchCommonConst.LOGINSERVICE).navigation(); // 定位监听 - CallerChassisLocationGCJ20ListenerManager.INSTANCE.addListener(TAG, mMapLocationListener); + CallerChassisLocationGCJ02ListenerManager.INSTANCE.addListener(TAG, mMapLocationListener); + CallerChassisLocationGCJ02ListenerManager.INSTANCE.setListenerHz(TAG,5);//设置5hz, 1s返回一次 MogoStatusManager.getInstance().registerStatusChangedListener(TAG, StatusDescriptor.VR_MODE, mMogoStatusChangedListener); @@ -303,7 +304,7 @@ public class OrderModel { MogoStatusManager.getInstance().unregisterStatusChangedListener(TAG, StatusDescriptor.VR_MODE, mMogoStatusChangedListener); // 注销定位监听 - CallerMapLocationListenerManager.INSTANCE.removeListener(TAG,false); + CallerChassisLocationGCJ02ListenerManager.INSTANCE.removeListener(TAG); //自动驾驶路线规划接口 CallerPlanningRottingListenerManager.INSTANCE.removeListener(moGoAutopilotPlanningListener); @@ -349,24 +350,25 @@ public class OrderModel { // 自车定位 private final IMoGoChassisLocationGCJ02Listener mMapLocationListener = new IMoGoChassisLocationGCJ02Listener() { + @Override - public void onChassisLocationGCJ02(@Nullable MessagePad.GnssInfo gnssInfo) { - if (null == gnssInfo) return; - mLongitude = gnssInfo.getLongitude(); - mLatitude = gnssInfo.getLatitude(); + public void onChassisLocationGCJ02(@Nullable MogoLocation mogoLocation) { + if (null == mogoLocation) return; + mLongitude = mogoLocation.getLongitude(); + mLatitude = mogoLocation.getLatitude(); if (mControllerStatusCallback != null) { - mControllerStatusCallback.onCarLocationChanged(gnssInfo); + mControllerStatusCallback.onCarLocationChanged(mogoLocation); } //是否到站的围栏判断 离站状态并且自动驾驶还未触发到站 if (isGoingToNextStation && !isArrivedStation) { - judgeArrivedStation(gnssInfo); + judgeArrivedStation(mogoLocation); } } }; //根据围栏判断,是否到达站点 - private void judgeArrivedStation(MessagePad.GnssInfo location) { + private void judgeArrivedStation(MogoLocation location) { if (backgroundCurrentStationIndex + 1 > stationList.size() - 1) { CallerLogger.INSTANCE.e(M_BUS + TAG, "到站数组越界"); @@ -471,7 +473,7 @@ public class OrderModel { String lineTime = DateTimeUtil.formatLongToString( busRoutesResult.getTaskTime(), - DateTimeUtil.TAXI_HH_mm); + DateTimeUtil.HH_mm); if (arrivingOrArrivedStationIndex == 0 || arrivingOrArrivedStation.getDrivingStatus() == STATION_STATUS_STOPPED @@ -609,7 +611,7 @@ public class OrderModel { return; } - CallerAutoPilotManager.INSTANCE.startAutoPilot(parameters); + CallerAutoPilotControlManager.INSTANCE.startAutoPilot(parameters); CallerLogger.INSTANCE.d(M_BUS + TAG, "行程日志-开启自动驾驶====" + GsonUtil.jsonFromObject(parameters) + " startLatLon=" + parameters.startName + ",endLatLon=" + parameters.endName + @@ -788,8 +790,8 @@ public class OrderModel { public void closeBeautificationMode() { if (FunctionBuildConfig.isDemoMode) {//收车结束美化 FunctionBuildConfig.isIgnoreConditionsDrawAutopilotTrajectoryData = false; //是否强制绘制引导线 - CallerAutoPilotManager.INSTANCE.setIgnoreConditionDraw(false);// 同步给乘客屏 - CallerAutoPilotManager.INSTANCE.setIPCDemoMode(false);//是否自动启动自驾 + CallerAutoPilotControlManager.INSTANCE.setIgnoreConditionDraw(false);// 同步给乘客屏 + CallerAutoPilotControlManager.INSTANCE.setIPCDemoMode(false);//是否自动启动自驾 CallerLogger.INSTANCE.d(M_BUS + TAG, "美化模式-ignore:置为false"); } } @@ -871,7 +873,7 @@ public class OrderModel { CallerLogger.INSTANCE.d(M_BUS + TAG, "美化模式-ignore:置为true(每次滑动出发)"); } else if (backgroundCurrentStationIndex > 0 && backgroundCurrentStationIndex < stationList.size() - 1) { //美化模式下 中间站点到站 引导线要一直绘制,所以此处不出强制绘制不传false - CallerAutoPilotManager.INSTANCE.setIPCDemoMode(false); + CallerAutoPilotControlManager.INSTANCE.setIPCDemoMode(false); CallerLogger.INSTANCE.d(M_BUS + TAG, "美化模式-ignore:false(到达中间站)"); clearStartAutopilotTag(); } else { @@ -962,8 +964,8 @@ public class OrderModel { private void startBeautificationMode() { FunctionBuildConfig.isIgnoreConditionsDrawAutopilotTrajectoryData = true; - CallerAutoPilotManager.INSTANCE.setIgnoreConditionDraw(true); - CallerAutoPilotManager.INSTANCE.setIPCDemoMode(true); + CallerAutoPilotControlManager.INSTANCE.setIgnoreConditionDraw(true); + CallerAutoPilotControlManager.INSTANCE.setIPCDemoMode(true); } public void clearBusStationDatas() { @@ -1002,7 +1004,7 @@ public class OrderModel { return; } CallerLogger.INSTANCE.d(M_BUS + TAG, "单程结束===="); - CallerAutoPilotManager.INSTANCE.cancelAutoPilot(); + CallerAutoPilotControlManager.INSTANCE.cancelAutoPilot(); endTask(); } diff --git a/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/biz/constant/OchCommonConst.kt b/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/biz/constant/OchCommonConst.kt index 2a200b6a86..8d2c9e4c93 100644 --- a/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/biz/constant/OchCommonConst.kt +++ b/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/biz/constant/OchCommonConst.kt @@ -13,7 +13,7 @@ class OchCommonConst { } @JvmStatic fun getShuttleUrl(): String { - return FunctionBuildConfig.urlJson.ochUrl + return FunctionBuildConfig.urlJson.shuttleUrl } // token 失效 重新获取token const val WAIT_TAKEN = 100046 diff --git a/app/productFlavors/fOchShuttle.gradle b/app/productFlavors/fOchShuttle.gradle index c918fa3c50..77f983fe00 100644 --- a/app/productFlavors/fOchShuttle.gradle +++ b/app/productFlavors/fOchShuttle.gradle @@ -20,7 +20,8 @@ project.android.productFlavors { // 车机类型,主要用于区分自研车机还是别人家的车机,自研车机类型为0 buildConfigField 'int', 'CAR_MACHINE_TYPE', '2' //高德地图鉴权信息 - manifestPlaceholders = [AMAP_API_VALUE: rootProject.ext.android.fLauncherAmapApiValue, CHANNEL_VALUE: "fOchShuttle",ACTIVITY_ROOT:true] + manifestPlaceholders = [AMAP_API_VALUE: rootProject.ext.android.fLauncherAmapApiValue, CHANNEL_VALUE: "fOchShuttle",ACTIVITY_ROOT:true, + SCREEN_ORIENTATION: "landscape"] // 是否基于地图 buildConfigField 'boolean', 'IS_MAP_BASED', 'true' diff --git a/app/urlConfig.json b/app/urlConfig.json index b61bbc5e97..9e547efde7 100644 --- a/app/urlConfig.json +++ b/app/urlConfig.json @@ -25,21 +25,21 @@ "dali": { "qa": { "och_url": "https://tech-qa.zhidaohulian.com", - "shuttle_url": "https://och-driver-qa.zhidaozhixing.com", + "shuttle_url": "https://och-a.zhidaozhixing.com", "passport_url": "https://och-a.zhidaozhixing.com/arch/passport/", "socket_base_url": "https://och-a.zhidaozhixing.com/arch/push/", "socket_tech_url": "https://och-a.zhidaozhixing.com/arch/" }, "online": { "och_url": "https://tech-qa.zhidaohulian.com", - "shuttle_url": "https://och-driver.zhidaozhixing.com", + "shuttle_url": "https://och-a.zhidaozhixing.com", "passport_url": "https://och-a.zhidaozhixing.com/arch/passport/", "socket_base_url": "https://och-a.zhidaozhixing.com/arch/push/", "socket_tech_url": "https://och-a.zhidaozhixing.com/arch/" }, "demo": { "och_url": "https://tech-qa.zhidaohulian.com", - "shuttle_url": "https://och-driver-dev.zhidaozhixing.com", + "shuttle_url": "https://och-a.zhidaozhixing.com", "passport_url": "https://och-a.zhidaozhixing.com/arch/passport/", "socket_base_url": "https://och-a.zhidaozhixing.com/arch/push/", "socket_tech_url": "https://och-a.zhidaozhixing.com/arch/"