From f1d0ccac1f2bc2f785a46b8b18bb443a70db2968 Mon Sep 17 00:00:00 2001 From: xinfengkun Date: Thu, 6 Apr 2023 17:19:54 +0800 Subject: [PATCH 1/7] =?UTF-8?q?[2.15.0][mogo-adas]=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E8=BD=A6=E8=BE=86=E8=BF=9B=E7=AB=99=E5=90=8E=E6=97=A0=E6=B3=95?= =?UTF-8?q?=E5=87=BA=E7=AB=99=E9=97=AE=E9=A2=98=EF=BC=8C=E6=A1=A3=E8=BD=A6?= =?UTF-8?q?=E5=A4=84=E4=BA=8E=E8=BF=9B=E7=AB=99=E6=B5=81=E7=A8=8B=E6=97=B6?= =?UTF-8?q?=E7=B3=BB=E7=BB=9F=E8=BF=98=E5=A4=84=E4=BA=8ESystemState.AUTO?= =?UTF-8?q?=5FPILOT=5FRUNNING=E7=8A=B6=E6=80=81=E6=89=80=E4=BB=A5=E9=9C=80?= =?UTF-8?q?=E8=A6=81=E5=B0=86=E6=AD=A4=E9=99=90=E5=88=B6=E6=94=BE=E5=BC=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../high/common/autopilot/ability/AutopilotAbility250.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/libraries/mogo-adas/src/main/java/com/zhidao/support/adas/high/common/autopilot/ability/AutopilotAbility250.java b/libraries/mogo-adas/src/main/java/com/zhidao/support/adas/high/common/autopilot/ability/AutopilotAbility250.java index 0c459e56a6..ff336195ee 100644 --- a/libraries/mogo-adas/src/main/java/com/zhidao/support/adas/high/common/autopilot/ability/AutopilotAbility250.java +++ b/libraries/mogo-adas/src/main/java/com/zhidao/support/adas/high/common/autopilot/ability/AutopilotAbility250.java @@ -79,6 +79,7 @@ public class AutopilotAbility250 { } } else { SystemStatusInfo.SystemState systemState = statusInfo.getSysState(); + // 目前已知可以下发启动自驾命令的状态: SystemState.SYS_RUNNING、SystemState.PILOT_READY、SystemState.AUTO_PILOT_STARTING、SystemState.AUTO_PILOT_RUNNING if (systemState != SystemStatusInfo.SystemState.SYS_RUNNING && systemState != SystemStatusInfo.SystemState.PILOT_READY) { isAutopilotAbility = false; if (systemState == SystemStatusInfo.SystemState.SYS_STARTING) { @@ -88,11 +89,13 @@ public class AutopilotAbility250 { } else if (systemState == SystemStatusInfo.SystemState.SYS_FAULT) { unableAutopilotReason = "系统异常"; } else if (systemState == SystemStatusInfo.SystemState.AUTO_PILOT_STARTING) { - //如果第一次下发了启动自动驾驶,没起来或者存在干预 此时systemState是AUTO_PILOT_STARTING 需要二次下发启动自驾命令 所以需要排除此状态 + //TODO 如果第一次下发了启动自动驾驶,没起来或者存在干预 此时systemState是AUTO_PILOT_STARTING 需要二次下发启动自驾命令 所以需要排除此状态 isAutopilotAbility = true; //unableAutopilotReason = "正在开始自动驾驶"; } else if (systemState == SystemStatusInfo.SystemState.AUTO_PILOT_RUNNING) { - unableAutopilotReason = "自动驾驶运行中"; + //TODO 车辆进站属于未退自驾状态,此状态不进行限制,否则无法再次发下启动自驾命令 + isAutopilotAbility = true; +// unableAutopilotReason = "自动驾驶运行中"; } else if (systemState == SystemStatusInfo.SystemState.REMOTE_PILOT_STARTING) { unableAutopilotReason = "平行驾驶启动中"; } else if (systemState == SystemStatusInfo.SystemState.REMOTE_PILOT_RUNNING) { From 8f17cf19987bb1613ad205f65d6a1a143849ba1e Mon Sep 17 00:00:00 2001 From: wangmingjun Date: Fri, 7 Apr 2023 19:21:14 +0800 Subject: [PATCH 2/7] =?UTF-8?q?[2.0.0]=20=E7=89=88=E6=9C=AC=E5=8F=B7?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B8=BA2.0.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- gradle.properties | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gradle.properties b/gradle.properties index 9a78d0c850..c4d7bbf1c4 100644 --- a/gradle.properties +++ b/gradle.properties @@ -93,8 +93,8 @@ WEBSOCKET_VERSION=1.1.7 applicationId=com.mogo.launcer applicationName=IntelligentPilot # RoboBus司机端:2.5.1;RoboTaxi司机端:2.5.1;RoboTaxi乘客端:1.0.0 -versionCode=3000000 -versionName=3.0.0 +versionCode=2000000 +versionName=2.0.0 ################# 新架构模块Maven版本管理 ################# MOGO_CORE_FUNCTION_HMI_VERSION=0.0.58.10 From 6b8b0f89a24e2aca6b3632b9f54cab868f361889 Mon Sep 17 00:00:00 2001 From: wangmingjun Date: Mon, 10 Apr 2023 15:30:36 +0800 Subject: [PATCH 3/7] =?UTF-8?q?[2.0.0]=20=E4=BF=AE=E5=A4=8D=E6=8E=A5?= =?UTF-8?q?=E9=A9=B3=E4=B9=98=E5=AE=A2=E5=B1=8F=E5=81=B6=E7=8E=B0=E8=B7=AF?= =?UTF-8?q?=E7=BA=BF=E4=B8=8D=E6=9B=B4=E6=96=B0=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../model/OchCommonLoginStatusDefaultModel.kt | 13 ++++------ .../mogo/och/data/bean/BusStationBean.java | 26 +++++++++++++++++++ .../passenger/model/BusPassengerModel.java | 3 ++- .../bus/passenger/model/PM2DrivingModel.kt | 5 ++-- .../src/m2/res/values/strings.xml | 2 +- .../com/mogo/och/bus/model/OrderModel.java | 2 +- 6 files changed, 38 insertions(+), 13 deletions(-) diff --git a/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/biz/model/OchCommonLoginStatusDefaultModel.kt b/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/biz/model/OchCommonLoginStatusDefaultModel.kt index 54a78bfcff..9e32bd2aa5 100644 --- a/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/biz/model/OchCommonLoginStatusDefaultModel.kt +++ b/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/biz/model/OchCommonLoginStatusDefaultModel.kt @@ -37,16 +37,13 @@ object OchCommonLoginStatusDefaultModel : OchCommonLoginStatusModel() { } loginCallback?.loginSuccess(data) - updateLoginLocalStatus(isLogin()) + data?.data?.driverStatus?.let { updateLoginLocalStatus(it) } } - private fun updateLoginLocalStatus(isLogin: Boolean) { - var loginCacheStatus = LoginCacheStatus(if (isLogin){ - 1 - }else { - 0 - },DateTimeUtil.getCurrentTimeStamp()) + private fun updateLoginLocalStatus(loginStatus: Int = 0) { + var loginCacheStatus = LoginCacheStatus(loginStatus,DateTimeUtil.getCurrentTimeStamp()) + CacheDataManager.instance.putCacheData(mContext, BusCacheKey.BUS_LOGIN_STATUS_CACHE, GsonUtils.toJson(loginCacheStatus)) } @@ -60,7 +57,7 @@ object OchCommonLoginStatusDefaultModel : OchCommonLoginStatusModel() { } loginCallback?.loginFail(isLogin) - updateLoginLocalStatus(isLogin) + updateLoginLocalStatus(0) } } \ No newline at end of file diff --git a/OCH/mogo-och-data/src/main/java/com/mogo/och/data/bean/BusStationBean.java b/OCH/mogo-och-data/src/main/java/com/mogo/och/data/bean/BusStationBean.java index 143bb43db7..20baf93478 100644 --- a/OCH/mogo-och-data/src/main/java/com/mogo/och/data/bean/BusStationBean.java +++ b/OCH/mogo-och-data/src/main/java/com/mogo/och/data/bean/BusStationBean.java @@ -1,5 +1,7 @@ package com.mogo.och.data.bean; +import java.util.Objects; + /** * 单个网约车小巴车站信息 * @@ -93,6 +95,28 @@ public class BusStationBean { this.leaving = leaving; } + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + BusStationBean that = (BusStationBean) o; + return siteId == that.siteId + && seq == that.seq + && Double.compare(that.gcjLon, gcjLon) == 0 + && Double.compare(that.gcjLat, gcjLat) == 0 + && Double.compare(that.lon, lon) == 0 + && Double.compare(that.lat, lat) == 0 + && drivingStatus == that.drivingStatus + && leaving == that.leaving + && name.equals(that.name) + && nameKr.equals(that.nameKr); + } + + @Override + public int hashCode() { + return Objects.hash(siteId, name, nameKr, seq, gcjLon, gcjLat, lon, lat, drivingStatus, leaving); + } + @Override public String toString() { return "BusStationBean{" + @@ -107,4 +131,6 @@ public class BusStationBean { ", leaving=" + leaving + '}'; } + + } diff --git a/OCH/mogo-och-shuttle-passenger/src/jinlvvan/java/com/mogo/och/bus/passenger/model/BusPassengerModel.java b/OCH/mogo-och-shuttle-passenger/src/jinlvvan/java/com/mogo/och/bus/passenger/model/BusPassengerModel.java index 58ac9e3d17..fa66012a85 100644 --- a/OCH/mogo-och-shuttle-passenger/src/jinlvvan/java/com/mogo/och/bus/passenger/model/BusPassengerModel.java +++ b/OCH/mogo-och-shuttle-passenger/src/jinlvvan/java/com/mogo/och/bus/passenger/model/BusPassengerModel.java @@ -273,7 +273,7 @@ public class BusPassengerModel { clearLocalRouteResult(); return; } - + CallerLogger.INSTANCE.d( M_BUS_P + TAG, "queryDriverSiteByCoordinate = update"); routesResult = result; if (mRouteLineInfoCallback != null){ @@ -578,6 +578,7 @@ public class BusPassengerModel { public void dynamicCalculateRouteInfo() { //计算当前位置和下一站的剩余点集合 //计算剩余点总里程和时间 + CallerLogger.INSTANCE.d(M_BUS_P + TAG, "轨迹排查==mTwoStationsRouts.size() = " + mTwoStationsRouts.size()); if (mTwoStationsRouts.size() == 0){ calculateTwoStationsRoute(); } diff --git a/OCH/mogo-och-shuttle-passenger/src/m2/java/com/mogo/och/bus/passenger/model/PM2DrivingModel.kt b/OCH/mogo-och-shuttle-passenger/src/m2/java/com/mogo/och/bus/passenger/model/PM2DrivingModel.kt index 98a3185650..977392b271 100644 --- a/OCH/mogo-och-shuttle-passenger/src/m2/java/com/mogo/och/bus/passenger/model/PM2DrivingModel.kt +++ b/OCH/mogo-och-shuttle-passenger/src/m2/java/com/mogo/och/bus/passenger/model/PM2DrivingModel.kt @@ -421,7 +421,7 @@ class PM2DrivingModel private constructor() { updateLocalOrder() return } - + d(SceneConstant.M_BUS_P+TAG, "queryDriverSiteByCoordinate= update") routesResult = result mDrivingInfoCallback?.updateLine(result.name, result.runningDur) @@ -445,6 +445,7 @@ class PM2DrivingModel private constructor() { mNextStationIndex = i + 1 return } else if (station.drivingStatus == BusPassengerConst.STATION_STATUS_STOPPED && !station.isLeaving) { + d(SceneConstant.M_BUS_P+TAG,"och-rotting--arrived ") mPreRouteIndex = 0 isGoingToNextStation = false startOrStopCalculateRouteInfo(false) @@ -484,7 +485,7 @@ class PM2DrivingModel private constructor() { fun dynamicCalculateRouteInfo(){ //计算当前位置和下一站的剩余点集合 //计算剩余点总里程和时间 - + d(SceneConstant.M_BUS_P + TAG, "och-rotting==mTwoStationsRouts.size() = " + mTwoStationsRouts.size) //计算当前位置和下一站的剩余点集合 //计算剩余点总里程和时间 if (mTwoStationsRouts.size == 0) { diff --git a/OCH/mogo-och-shuttle-passenger/src/m2/res/values/strings.xml b/OCH/mogo-och-shuttle-passenger/src/m2/res/values/strings.xml index 9f2f2d5094..96812ea23f 100644 --- a/OCH/mogo-och-shuttle-passenger/src/m2/res/values/strings.xml +++ b/OCH/mogo-och-shuttle-passenger/src/m2/res/values/strings.xml @@ -13,7 +13,7 @@ m2_map_style.data m2_map_style_extra.data - Auto + AUTO 下一站: 已到站 暂无站点 diff --git a/OCH/mogo-och-shuttle/src/main/java/com/mogo/och/bus/model/OrderModel.java b/OCH/mogo-och-shuttle/src/main/java/com/mogo/och/bus/model/OrderModel.java index 3b8cd646ce..f3e2f4c563 100644 --- a/OCH/mogo-och-shuttle/src/main/java/com/mogo/och/bus/model/OrderModel.java +++ b/OCH/mogo-och-shuttle/src/main/java/com/mogo/och/bus/model/OrderModel.java @@ -79,7 +79,6 @@ import com.mogo.och.common.module.voice.VoiceNotice; import com.mogo.och.common.module.bean.dpmsg.BusCacheKey; import com.mogo.och.data.bean.BusTransferData; import com.mogo.och.data.manager.cache.CacheDataManager; -import com.zhidao.socket.utils.LoginStatusUtil; import org.jetbrains.annotations.NotNull; @@ -829,6 +828,7 @@ public class OrderModel { private void pushCacheTransferData(BusRoutesResult result) { BusTransferData data = new BusTransferData(LoginStatusManager.isLogin() ? 1:0,result); + CallerLogger.INSTANCE.d(M_BUS + TAG, "pushCacheTransferData = " + GsonUtils.toJson(data)); CacheDataManager.Companion.getInstance().putCacheData(mContext, BusCacheKey.BUS_LINE_CACHE, GsonUtils.toJson(data)); From 2496875fb67036866f0ebbfd224fbda07ceff82d Mon Sep 17 00:00:00 2001 From: pangfan Date: Thu, 13 Apr 2023 20:47:39 +0800 Subject: [PATCH 4/7] =?UTF-8?q?[=E5=A4=A7=E7=90=86/=E7=83=9F=E5=8F=B0?= =?UTF-8?q?=E4=BA=A4=E4=BB=98]release=20v2.1.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- gradle.properties | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gradle.properties b/gradle.properties index 0dfa2aba59..c489469189 100644 --- a/gradle.properties +++ b/gradle.properties @@ -93,8 +93,8 @@ WEBSOCKET_VERSION=1.1.7 applicationId=com.mogo.launcer applicationName=IntelligentPilot # RoboBus司机端:2.5.1;RoboTaxi司机端:2.5.1;RoboTaxi乘客端:1.0.0 -versionCode=2000000 -versionName=2.0.0 +versionCode=2010000 +versionName=2.1.0 ################# 新架构模块Maven版本管理 ################# MOGO_CORE_FUNCTION_HMI_VERSION=0.0.58.10 From 1d49120170449c20e687464ed2589564f18b3935 Mon Sep 17 00:00:00 2001 From: yangyakun Date: Fri, 14 Apr 2023 16:01:15 +0800 Subject: [PATCH 5/7] =?UTF-8?q?[m2]=20[3.1.0]=20[=E9=9A=90=E8=97=8FUi]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/m2/res/layout/p_m2_driving_info_fragment.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OCH/mogo-och-shuttle-passenger/src/m2/res/layout/p_m2_driving_info_fragment.xml b/OCH/mogo-och-shuttle-passenger/src/m2/res/layout/p_m2_driving_info_fragment.xml index ae19ca5741..c772fbf3fd 100644 --- a/OCH/mogo-och-shuttle-passenger/src/m2/res/layout/p_m2_driving_info_fragment.xml +++ b/OCH/mogo-och-shuttle-passenger/src/m2/res/layout/p_m2_driving_info_fragment.xml @@ -321,7 +321,7 @@ android:id="@+id/view_split" android:layout_marginTop="@dimen/dp_30" app:layout_constraintTop_toTopOf="@+id/aciv_speed_time_bg" - app:layout_constraintBottom_toBottomOf="@+id/turn_light_view" + app:layout_constraintBottom_toBottomOf="@+id/auto_tv" app:layout_constraintStart_toStartOf="@+id/aciv_speed_time_bg" app:layout_constraintEnd_toEndOf="@+id/aciv_speed_time_bg" android:background="@color/shuttle_color_6617417B" From 9936fb84acc09e354672be7d84433f845d88edee Mon Sep 17 00:00:00 2001 From: yangyakun Date: Fri, 14 Apr 2023 17:23:12 +0800 Subject: [PATCH 6/7] =?UTF-8?q?[m2]=20[3.1.0]=20[=E5=8A=A8=E7=94=BB?= =?UTF-8?q?=E5=B1=95=E7=A4=BA=E5=92=8C=E9=9A=90=E8=97=8F]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mogo/och/bus/passenger/ui/PM2DrivingInfoFragment.kt | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/OCH/mogo-och-shuttle-passenger/src/m2/java/com/mogo/och/bus/passenger/ui/PM2DrivingInfoFragment.kt b/OCH/mogo-och-shuttle-passenger/src/m2/java/com/mogo/och/bus/passenger/ui/PM2DrivingInfoFragment.kt index 8d12623b3f..a425b7c179 100644 --- a/OCH/mogo-och-shuttle-passenger/src/m2/java/com/mogo/och/bus/passenger/ui/PM2DrivingInfoFragment.kt +++ b/OCH/mogo-och-shuttle-passenger/src/m2/java/com/mogo/och/bus/passenger/ui/PM2DrivingInfoFragment.kt @@ -207,13 +207,9 @@ class PM2DrivingInfoFragment : tv_distance.text = resources.getString(R.string.m2_p_empty_remain_km) tv_left_time.text = resources.getString(R.string.m2_p_empty_remain_minute) tv_next_station_title.text = resources.getString(R.string.m2_p_station_title_arrived_tv) - iv_animal_list.visibility = View.VISIBLE - val animationDrawable = iv_animal_list.drawable as AnimationDrawable - animationDrawable.start() haveLineAndArrivedStation() }else{ //前往目的地中 tv_next_station_title.text = resources.getString(R.string.shuttle_p_next_station_title) - iv_animal_list.visibility = View.GONE haveLineAndArriveingStation() } } @@ -250,6 +246,7 @@ class PM2DrivingInfoFragment : clg_distance_left_time.visibility = View.GONE // 到达站点 tv_arrived_notice.visibility = View.GONE + iv_animal_list.visibility = View.GONE } // 有线路正在到站点 fun haveLineAndArriveingStation(){ @@ -257,6 +254,7 @@ class PM2DrivingInfoFragment : group_stationinfo.visibility = View.VISIBLE clg_distance_left_time.visibility = View.VISIBLE tv_arrived_notice.visibility = View.GONE + iv_animal_list.visibility = View.GONE } // 有线路到达站点 fun haveLineAndArrivedStation(){ @@ -264,6 +262,9 @@ class PM2DrivingInfoFragment : group_stationinfo.visibility = View.VISIBLE clg_distance_left_time.visibility = View.GONE tv_arrived_notice.visibility = View.VISIBLE + iv_animal_list.visibility = View.VISIBLE + val animationDrawable = iv_animal_list.drawable as AnimationDrawable + animationDrawable.start() } companion object { From c7303eca7fa24ed5c232c9e0e23392f0dc2f55e8 Mon Sep 17 00:00:00 2001 From: chenfufeng Date: Wed, 22 Feb 2023 21:30:42 +0800 Subject: [PATCH 7/7] =?UTF-8?q?[2.15.0][Fix]=E8=A7=A3=E5=86=B3=E9=A6=96?= =?UTF-8?q?=E6=AC=A1=E5=AE=89=E8=A3=85App=E6=97=B6=E6=97=A0=E6=B3=95?= =?UTF-8?q?=E8=8E=B7=E5=BE=97=E9=AB=98=E5=BE=B7=E5=AE=9A=E4=BD=8D=E5=AF=BC?= =?UTF-8?q?=E8=87=B4=E7=9A=84=E9=AB=98=E7=B2=BE=E5=9C=B0=E5=9B=BE=E7=BC=93?= =?UTF-8?q?=E5=AD=98=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../function/hmi/ui/map/OfflineMapDialog.kt | 27 ++++++++++-- .../hmi/ui/widget/SystemVersionView.kt | 23 +++++++++- .../src/main/res/values/strings.xml | 1 + .../call/map/CallerMapUIServiceManager.kt | 9 ++++ .../uicontroller/IMogoMapUIController.java | 4 ++ .../java/com/mogo/map/AMapViewWrapper.java | 43 +++++++++++++++++++ .../com/mogo/map/MogoMapUIController.java | 15 +++++++ .../map/uicontroller/AMapUIController.java | 15 +++++++ 8 files changed, 132 insertions(+), 5 deletions(-) diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/map/OfflineMapDialog.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/map/OfflineMapDialog.kt index e7c083b27e..1a9e2e7e02 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/map/OfflineMapDialog.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/map/OfflineMapDialog.kt @@ -8,6 +8,7 @@ import android.widget.ProgressBar import android.widget.TextView import androidx.constraintlayout.widget.ConstraintLayout import androidx.core.content.ContextCompat +import com.mogo.eagle.core.data.map.MogoLocation import com.mogo.eagle.core.function.call.hmi.CallerHmiListenerManager import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager import com.mogo.eagle.core.function.hmi.R @@ -37,6 +38,8 @@ class OfflineMapDialog(context: Context): BaseFloatDialog(context) { private var isConfirm = true private var isRetry = false + var location: MogoLocation? = null + init { setContentView(R.layout.dialog_offline_map) setCanceledOnTouchOutside(true) @@ -89,8 +92,8 @@ class OfflineMapDialog(context: Context): BaseFloatDialog(context) { } } - private fun cacheHDOfflineData() { - CallerMapUIServiceManager.cacheHDDataByCity(object : IHdCacheListener { + private fun cacheHDDataByCityByLonLat() { + CallerMapUIServiceManager.cacheHDDataByCityByLonLat(object : IHdCacheListener { override fun onMapHdCacheProgress(cityId: Int, progress: Double) { updateProgress(progress.toInt()) } @@ -100,7 +103,25 @@ class OfflineMapDialog(context: Context): BaseFloatDialog(context) { showNewContent(isLoading = false, false) } } - }) + }, location!!) + } + + private fun cacheHDOfflineData() { + if (location == null) {// 拿到了高德地图的cityCode + CallerMapUIServiceManager.cacheHDDataByCity(object : IHdCacheListener { + override fun onMapHdCacheProgress(cityId: Int, progress: Double) { + updateProgress(progress.toInt()) + } + + override fun onMapHdCacheResult(cityId: Int, state: Int) { + if (state == 0) {// 失败 + showNewContent(isLoading = false, false) + } + } + }) + } else {// 只拿到了高精的经纬度 + cacheHDDataByCityByLonLat() + } } @SuppressLint("SetTextI18n") diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/SystemVersionView.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/SystemVersionView.kt index 1418bac233..fe3788f461 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/SystemVersionView.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/SystemVersionView.kt @@ -8,10 +8,13 @@ import androidx.constraintlayout.widget.ConstraintLayout import com.mogo.eagle.core.data.autopilot.AutopilotStatusInfo import com.mogo.eagle.core.data.deva.bindingcar.AdUpgradeStateHelper import com.mogo.eagle.core.data.deva.bindingcar.IPCUpgradeStateInfo +import com.mogo.eagle.core.data.map.MogoLocation import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener +import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationWGS84Listener import com.mogo.eagle.core.function.api.devatools.IMoGoDevaToolsListener import com.mogo.eagle.core.function.api.hmi.autopilot.IMoGoCheckAutoPilotBtnListener import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager +import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationWGS84ListenerManager import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsListenerManager import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager import com.mogo.eagle.core.function.call.hmi.CallerHmiListenerManager @@ -37,7 +40,7 @@ class SystemVersionView @JvmOverloads constructor( attrs: AttributeSet? = null, defStyleAttr: Int = 0 ) : ConstraintLayout(context, attrs, defStyleAttr), IMoGoAutopilotStatusListener, - IMoGoDevaToolsListener, IMoGoCheckAutoPilotBtnListener { + IMoGoDevaToolsListener, IMoGoCheckAutoPilotBtnListener, IMoGoChassisLocationWGS84Listener { companion object { const val TAG = "SystemVersionView" @@ -55,6 +58,7 @@ class SystemVersionView @JvmOverloads constructor( private var currentProgress: Int = -1 //当前已下载包体大小 private var isHDCached = false + private var location: MogoLocation? = null init { LayoutInflater.from(context).inflate(R.layout.view_system_version, this, true) @@ -137,7 +141,17 @@ class SystemVersionView @JvmOverloads constructor( if (isHDCached) {// 已缓存 ToastUtils.showShort(resources.getString(R.string.offline_had_downloaded)) } else {// 未缓存 - OfflineMapDialog(context).show() + if (CallerMapUIServiceManager.getCityCode().isNullOrEmpty()) {// 未拿到高德的cityCode + if (location == null || (location!!.longitude <= 0.0 && location!!.latitude <= 0.0)) {// 未拿到高精的经纬度 + ToastUtils.showShort(resources.getString(R.string.location_try_again)) + } else {// 拿到了高精的经纬度 + val dialog = OfflineMapDialog(context) + dialog.location = location + dialog.show() + } + } else {// 拿到高德的cityCode + OfflineMapDialog(context).show() + } } } @@ -292,6 +306,7 @@ class SystemVersionView @JvmOverloads constructor( CallerHmiListenerManager.addListener(TAG, this) CallerAutoPilotStatusListenerManager.addListener(TAG, this) CallerDevaToolsListenerManager.addListener(TAG,this) + CallerChassisLocationWGS84ListenerManager.addListener(TAG, this) needQueryContainers = true } @@ -303,6 +318,7 @@ class SystemVersionView @JvmOverloads constructor( CallerHmiListenerManager.removeListener(TAG) CallerAutoPilotStatusListenerManager.removeListener(TAG) CallerDevaToolsListenerManager.removeListener(TAG) + CallerChassisLocationWGS84ListenerManager.removeListener(TAG) needQueryContainers = false } @@ -361,4 +377,7 @@ class SystemVersionView @JvmOverloads constructor( adCircularProgressView?.visibility = View.GONE } + override fun onChassisLocationWGS84(gnssInfo: MogoLocation) { + location = gnssInfo + } } \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/values/strings.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/values/strings.xml index 325ba8e816..bcfc49ef69 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/res/values/strings.xml +++ b/core/function-impl/mogo-core-function-hmi/src/main/res/values/strings.xml @@ -75,6 +75,7 @@ 离线地图下载成功 离线地图下载失败 当前已为最新版本 + 请检查定位是否正常 确定 重试 diff --git a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/map/CallerMapUIServiceManager.kt b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/map/CallerMapUIServiceManager.kt index 6db8e65512..a7bedbeda3 100644 --- a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/map/CallerMapUIServiceManager.kt +++ b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/map/CallerMapUIServiceManager.kt @@ -2,6 +2,7 @@ package com.mogo.eagle.core.function.call.map import android.content.Context import com.mogo.eagle.core.data.constants.MogoServicePaths +import com.mogo.eagle.core.data.map.MogoLocation import com.mogo.eagle.core.function.api.map.IMogoMapService import com.mogo.eagle.core.function.api.map.marker.IMogoMarkerService import com.mogo.eagle.core.function.call.base.CallerBase @@ -35,6 +36,10 @@ object CallerMapUIServiceManager { serviceProvider?.mapUIController?.cacheHDDataByCity(listener) } + fun cacheHDDataByCityByLonLat(listener: IHdCacheListener, location: MogoLocation) { + serviceProvider?.mapUIController?.cacheHDDataByCity(listener, location) + } + fun isCityDataCached(): Boolean { return serviceProvider?.mapUIController?.isCityDataCached ?: false } @@ -50,4 +55,8 @@ object CallerMapUIServiceManager { fun cancelDownloadCacheData() { serviceProvider?.mapUIController?.cancelDownloadCacheData() } + + fun getCityCode(): String? { + return serviceProvider?.mapUIController?.cityCode + } } \ No newline at end of file diff --git a/libraries/mogo-map-api/src/main/java/com/mogo/map/uicontroller/IMogoMapUIController.java b/libraries/mogo-map-api/src/main/java/com/mogo/map/uicontroller/IMogoMapUIController.java index 50190778f2..12306b6eb4 100644 --- a/libraries/mogo-map-api/src/main/java/com/mogo/map/uicontroller/IMogoMapUIController.java +++ b/libraries/mogo-map-api/src/main/java/com/mogo/map/uicontroller/IMogoMapUIController.java @@ -360,6 +360,8 @@ public interface IMogoMapUIController { void setPointCloudColor(String color); void cacheHDDataByCity(IHdCacheListener listener); + void cacheHDDataByCity(IHdCacheListener listener, MogoLocation location); + /** * 当前城市离线数据是否已缓存 * @return @@ -367,4 +369,6 @@ public interface IMogoMapUIController { boolean isCityDataCached(); void cancelDownloadCacheData(); + + String getCityCode(); } diff --git a/libraries/mogo-map/src/main/java/com/mogo/map/AMapViewWrapper.java b/libraries/mogo-map/src/main/java/com/mogo/map/AMapViewWrapper.java index 06e6fe5eb2..7c65130bd9 100644 --- a/libraries/mogo-map/src/main/java/com/mogo/map/AMapViewWrapper.java +++ b/libraries/mogo-map/src/main/java/com/mogo/map/AMapViewWrapper.java @@ -1075,6 +1075,44 @@ public class AMapViewWrapper implements IMogoMapView, } } + @Override + public void cacheHDDataByCity(IHdCacheListener listener, MogoLocation location) { + if (mMapView.getMapAutoViewHelper() != null) { + hdCacheListener = listener; + mMapView.getMapAutoViewHelper().cacheHDDataByCityByLonLat(location.getLongitude(), location.getLatitude(), new OnHdDataDownByCityListener() { + @Override + public void onMapHDDataCacheProgressByCity(int cityId, double progress) { + if (Thread.currentThread() == Looper.getMainLooper().getThread()) { + if (hdCacheListener != null) { + hdCacheListener.onMapHdCacheProgress(cityId, progress * 100); + } + } else { + UiThreadHandler.post(() -> { + if (hdCacheListener != null) { + hdCacheListener.onMapHdCacheProgress(cityId, progress * 100); + } + }); + } + } + + @Override + public void onMapHDDataCacheStateByCity(int i, int state) {// 0失败,1成功 + if (Thread.currentThread() == Looper.getMainLooper().getThread()) { + if (hdCacheListener != null) { + hdCacheListener.onMapHdCacheResult(i, state); + } + } else { + UiThreadHandler.post(() -> { + if (hdCacheListener != null) { + hdCacheListener.onMapHdCacheResult(i, state); + } + }); + } + } + }); + } + } + @Override public boolean isCityDataCached() { if (mMapView.getMapAutoViewHelper() != null) { @@ -1100,4 +1138,9 @@ public class AMapViewWrapper implements IMogoMapView, mMapView.getMapAutoViewHelper().cancelCacheHDData(); } } + + @Override + public String getCityCode() { + return GDLocationClient.getInstance(getContext()).getLastCityCode(); + } } diff --git a/libraries/mogo-map/src/main/java/com/mogo/map/MogoMapUIController.java b/libraries/mogo-map/src/main/java/com/mogo/map/MogoMapUIController.java index 80605f5aed..ec7c4ad156 100644 --- a/libraries/mogo-map/src/main/java/com/mogo/map/MogoMapUIController.java +++ b/libraries/mogo-map/src/main/java/com/mogo/map/MogoMapUIController.java @@ -468,6 +468,13 @@ public class MogoMapUIController implements IMogoMapUIController { } } + @Override + public void cacheHDDataByCity(IHdCacheListener listener, MogoLocation location) { + if (mDelegate != null) { + mDelegate.cacheHDDataByCity(listener, location); + } + } + @Override public boolean isCityDataCached() { if (mDelegate != null) { @@ -482,4 +489,12 @@ public class MogoMapUIController implements IMogoMapUIController { mDelegate.cancelDownloadCacheData(); } } + + @Override + public String getCityCode() { + if (mDelegate != null) { + return mDelegate.getCityCode(); + } + return null; + } } diff --git a/libraries/mogo-map/src/main/java/com/mogo/map/uicontroller/AMapUIController.java b/libraries/mogo-map/src/main/java/com/mogo/map/uicontroller/AMapUIController.java index 82f1a8756a..34234961e4 100644 --- a/libraries/mogo-map/src/main/java/com/mogo/map/uicontroller/AMapUIController.java +++ b/libraries/mogo-map/src/main/java/com/mogo/map/uicontroller/AMapUIController.java @@ -406,6 +406,13 @@ public class AMapUIController implements IMogoMapUIController { } } + @Override + public void cacheHDDataByCity(IHdCacheListener listener, MogoLocation location) { + if (mClient != null) { + mClient.cacheHDDataByCity(listener, location); + } + } + @Override public boolean isCityDataCached() { if (mClient != null) { @@ -420,4 +427,12 @@ public class AMapUIController implements IMogoMapUIController { mClient.cancelDownloadCacheData(); } } + + @Override + public String getCityCode() { + if (mClient != null) { + return mClient.getCityCode(); + } + return null; + } }