Merge branch 'release_robotaxi-d-app-module_240_230131_2.14.0.1'
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
package com.mogo.och.taxi.passenger.model;
|
||||
|
||||
import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_TAXI_P;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import com.amap.api.services.core.AMapException;
|
||||
@@ -17,8 +19,6 @@ import java.util.List;
|
||||
import java.util.Timer;
|
||||
import java.util.TimerTask;
|
||||
|
||||
import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_TAXI_P;
|
||||
|
||||
/**
|
||||
* @author: wangmingjun
|
||||
* @date: 2021/12/6
|
||||
|
||||
@@ -23,9 +23,10 @@ ext {
|
||||
// amapnavi3dmap : "com.amap.api:navi-3dmap:8.0.1_3dmap8.0.1",
|
||||
// amapsearch : "com.amap.api:search:7.9.0",
|
||||
// amaplocation : "com.amap.api:location:5.5.0",
|
||||
amapnavi3dmap : "com.amap.api:navi-3dmap:9.5.1_3dmap9.5.0",
|
||||
amapnavi3dmap : "com.amap.api:navi-3dmap:9.6.0_3dmap9.6.0",
|
||||
amapsearch : "com.amap.api:search:9.5.0",
|
||||
amaplocation : "com.amap.api:location:6.2.0",
|
||||
|
||||
// json 转换
|
||||
gson : "com.google.code.gson:gson:2.8.4",
|
||||
// 内存泄漏检测
|
||||
|
||||
@@ -52,6 +52,8 @@ public class BindingcarProvider implements IMoGoBindingcarProvider {
|
||||
public void init(Context context) {
|
||||
mContext = context;
|
||||
IPCUpgradeManager.Companion.getINSTANCE().initServer(context);
|
||||
SharedPrefsMgr.getInstance(mContext).putLong("typeDriver", 0);
|
||||
SharedPrefsMgr.getInstance(mContext).putLong("typePassenger", 0);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -3,7 +3,6 @@ package com.mogo.eagle.core.function.bindingcar.network;
|
||||
import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_BINDING;
|
||||
|
||||
import android.content.Context;
|
||||
import android.util.Log;
|
||||
|
||||
import com.mogo.commons.constants.HostConst;
|
||||
import com.mogo.commons.constants.SharedPrefsConstants;
|
||||
@@ -80,9 +79,7 @@ public class BindingcarNetWorkManager {
|
||||
if (info != null && info.getData() != null) {
|
||||
CallerLogger.INSTANCE.d(M_BINDING + TAG, "getBindingcarInfo onNext info.getData() =" + info.getData().toString());
|
||||
//根据车辆类型切换不同的车辆模型,只针对红旗做处理
|
||||
if (!SharedPrefsMgr.getInstance(context).getString(SharedPrefsConstants.MAC_ADDRESS).equals(macAddress)) {
|
||||
updateCarVrIconRes(info.getData().getBrandId());
|
||||
}
|
||||
updateCarVrIconRes(info.getData().getBrandId());
|
||||
switch (info.getData().getCompare()) {
|
||||
case "0":
|
||||
CallerHmiManager.INSTANCE.showBindingcarDialog();
|
||||
@@ -95,7 +92,6 @@ public class BindingcarNetWorkManager {
|
||||
break;
|
||||
}
|
||||
SharedPrefsMgr.getInstance(context).putString(SharedPrefsConstants.CAR_INFO, GsonUtils.toJson(info.getData()));
|
||||
SharedPrefsMgr.getInstance(context).putString(SharedPrefsConstants.MAC_ADDRESS, macAddress);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -116,8 +112,6 @@ public class BindingcarNetWorkManager {
|
||||
* mac: 48:b0:2d:3a:9c:19
|
||||
*/
|
||||
public void modifyBindingcar(Context context, String macAddress, String widevineIDWithMd5, BindingcarCallBack callBack, int screenType) {
|
||||
// String macAddress1 = "48:b0:2d:4d:33:40";
|
||||
// String sn = "X2020220417KA94QIN";
|
||||
BindingcarRequest request = new BindingcarRequest(macAddress, widevineIDWithMd5, screenType);
|
||||
RequestBody requestBody = RequestBody.create(MediaType.get("application/json;charset=UTF-8"), GsonUtil.jsonFromObject(request));
|
||||
mBindingcarApiService.modifyBindingcarInfo(requestBody)
|
||||
@@ -133,10 +127,7 @@ public class BindingcarNetWorkManager {
|
||||
if (info != null) {
|
||||
callBack.callBackResult(info);
|
||||
CallerLogger.INSTANCE.d(M_BINDING + TAG, "modifyBindingcar onNext code = " + info.code + "---msg = " + info.msg + "--info.toString() = " + info.toString());
|
||||
if (!SharedPrefsMgr.getInstance(context).getString(SharedPrefsConstants.MAC_ADDRESS).equals(macAddress)) {
|
||||
updateCarVrIconRes(info.getData().getBrandId());
|
||||
}
|
||||
SharedPrefsMgr.getInstance(context).putString(SharedPrefsConstants.MAC_ADDRESS, macAddress);
|
||||
updateCarVrIconRes(info.getData().getBrandId());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -152,30 +143,43 @@ public class BindingcarNetWorkManager {
|
||||
|
||||
}
|
||||
|
||||
private void updateCarVrIconRes(String brandId){
|
||||
if(brandId == null || brandId.isEmpty()){
|
||||
private void updateCarVrIconRes(String brandId) {
|
||||
if (brandId == null || brandId.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
CallerLogger.INSTANCE.d(M_BINDING + TAG,"updateCarVrIconRes : " + brandId);
|
||||
switch (brandId){
|
||||
if(getDefaultId().equals(brandId)){
|
||||
return;
|
||||
}
|
||||
CallerLogger.INSTANCE.d(M_BINDING + TAG, "updateCarVrIconRes : " + brandId);
|
||||
switch (brandId) {
|
||||
case "1":
|
||||
CallerHDMapManager.INSTANCE.changeCurrentIcon(R.raw.chuzuche);
|
||||
HdMapBuildConfig.currentCarVrIconRes =R.raw.chuzuche;
|
||||
HdMapBuildConfig.currentCarVrIconRes = R.raw.chuzuche;
|
||||
break;
|
||||
case "2":
|
||||
CallerHDMapManager.INSTANCE.changeCurrentIcon(R.raw.hq_h9);
|
||||
HdMapBuildConfig.currentCarVrIconRes =R.raw.hq_h9;
|
||||
HdMapBuildConfig.currentCarVrIconRes = R.raw.hq_h9;
|
||||
break;
|
||||
case "3":
|
||||
CallerHDMapManager.INSTANCE.changeCurrentIcon(R.raw.xiaobache);
|
||||
HdMapBuildConfig.currentCarVrIconRes =R.raw.xiaobache;
|
||||
HdMapBuildConfig.currentCarVrIconRes = R.raw.xiaobache;
|
||||
break;
|
||||
default:
|
||||
CallerHDMapManager.INSTANCE.changeCurrentIcon(R.raw.chuzuche);
|
||||
HdMapBuildConfig.currentCarVrIconRes =R.raw.chuzuche;
|
||||
HdMapBuildConfig.currentCarVrIconRes = R.raw.chuzuche;
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private String getDefaultId(){
|
||||
if(HdMapBuildConfig.currentCarVrIconRes == R.raw.chuzuche){
|
||||
return "1";
|
||||
}
|
||||
if(HdMapBuildConfig.currentCarVrIconRes == R.raw.xiaobache){
|
||||
return "3";
|
||||
}
|
||||
return "1";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -28,6 +28,7 @@ import com.zhjt.mogo_core_function_devatools.badcase.consts.BadCaseConfig.bagMan
|
||||
import com.zhjt.mogo_core_function_devatools.badcase.record.Audition
|
||||
import kotlinx.android.synthetic.main.layout_badcase_manager.view.*
|
||||
import java.util.*
|
||||
import kotlin.collections.ArrayList
|
||||
|
||||
|
||||
/**
|
||||
@@ -61,6 +62,8 @@ class BadCaseManagerView @JvmOverloads constructor(
|
||||
|
||||
private var isNameModify = false
|
||||
|
||||
private val deleteDataList: ArrayList<BagInfoEntity> = ArrayList()
|
||||
|
||||
init {
|
||||
LayoutInflater.from(context).inflate(R.layout.layout_badcase_manager, this, true)
|
||||
initView()
|
||||
@@ -381,14 +384,23 @@ class BadCaseManagerView @JvmOverloads constructor(
|
||||
0 -> {
|
||||
ToastUtils.showShort("${bagManager.uploadCosResp.key} 上传cos桶成功")
|
||||
}
|
||||
1 -> {
|
||||
//执行中
|
||||
}
|
||||
2 -> {
|
||||
ToastUtils.showShort("${bagManager.uploadCosResp.key} 上传cos桶copy过程失败,原因:${bagManager.uploadCosResp.message}")
|
||||
ToastUtils.showShort("${bagManager.uploadCosResp.key} 上传cos桶执行python失败")
|
||||
}
|
||||
3 -> {
|
||||
ToastUtils.showShort("${bagManager.uploadCosResp.key} 上传cos桶合并过程失败,原因:${bagManager.uploadCosResp.message}")
|
||||
ToastUtils.showShort("${bagManager.uploadCosResp.key} 上传cos桶拷贝过程失败")
|
||||
}
|
||||
4 -> {
|
||||
ToastUtils.showShort("${bagManager.uploadCosResp.key} 上传cos桶上传过程失败,原因:${bagManager.uploadCosResp.message}")
|
||||
ToastUtils.showShort("${bagManager.uploadCosResp.key} 上传cos桶合并过程失败")
|
||||
}
|
||||
5 -> {
|
||||
ToastUtils.showShort("${bagManager.uploadCosResp.key} 上传cos桶上传过程失败")
|
||||
}
|
||||
else -> {
|
||||
ToastUtils.showShort("${bagManager.uploadCosResp.key} 上传cos桶 ${bagManager.uploadCosResp.message}")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -404,36 +416,55 @@ class BadCaseManagerView @JvmOverloads constructor(
|
||||
bagManagerList.remove(deleteBagInfo)
|
||||
//更新列表
|
||||
// bagManagerListAdapter?.setData(bagManagerEntity.bagsInfoResp)
|
||||
if(bagManagerList.size>0){
|
||||
//继续执行删除命令
|
||||
bagManagerEntity.reqType = 4
|
||||
bagManagerEntity.keyReq = bagManagerList[0].key
|
||||
CallerAutoPilotManager.sendBagManagerCmd(bagManagerEntity)
|
||||
}
|
||||
}
|
||||
}
|
||||
//遍历列表,如当天Bag全部删除,同时把日期标题也删除更新列表
|
||||
deleteDataList.clear()
|
||||
val titleIterator = bagManagerEntity.bagsInfoResp.iterator()
|
||||
while(titleIterator.hasNext()){
|
||||
val titleBagInfo = titleIterator.next()
|
||||
if(titleBagInfo.itemType == 1){
|
||||
val bagIterator = bagManagerEntity.bagsInfoResp.iterator()
|
||||
var hasBag = false
|
||||
var bagBagInfo: BagInfoEntity ?= null
|
||||
while(bagIterator.hasNext()){
|
||||
val bagBagInfo = bagIterator.next()
|
||||
bagBagInfo = bagIterator.next()
|
||||
if(bagBagInfo.itemType == 0){
|
||||
bagBagInfo.timestamp?.let {
|
||||
if(it.contains(titleBagInfo.timestamp.toString())){
|
||||
bagBagInfo.timestamp.let {
|
||||
if(it.contains(titleBagInfo.timestamp)){
|
||||
hasBag = true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if(!hasBag){
|
||||
bagIterator.remove()
|
||||
// bagIterator.remove()
|
||||
titleBagInfo.let { deleteDataList.add(it) }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(deleteDataList.isNotEmpty()){
|
||||
val deleteIterator = bagManagerEntity.bagsInfoResp.iterator()
|
||||
while(deleteIterator.hasNext()){
|
||||
val deleteInfo = deleteIterator.next()
|
||||
if(deleteDataList.contains(deleteInfo)){
|
||||
deleteIterator.remove()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(bagManagerList.size == 0){
|
||||
tvCancelSelect.performClick()
|
||||
}
|
||||
|
||||
if(bagManagerList.size>0){
|
||||
//继续执行删除命令
|
||||
bagManagerEntity.reqType = 4
|
||||
bagManagerEntity.keyReq = bagManagerList[0].key
|
||||
CallerAutoPilotManager.sendBagManagerCmd(bagManagerEntity)
|
||||
}
|
||||
|
||||
//更新列表
|
||||
bagManagerListAdapter?.setData(bagManagerEntity.bagsInfoResp)
|
||||
}
|
||||
|
||||
@@ -6,11 +6,9 @@ import android.view.View
|
||||
import android.widget.ImageView
|
||||
import android.widget.ProgressBar
|
||||
import android.widget.TextView
|
||||
import androidx.annotation.MainThread
|
||||
import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import androidx.core.content.ContextCompat
|
||||
import androidx.core.content.res.ResourcesCompat
|
||||
import androidx.core.view.marginTop
|
||||
import com.mogo.eagle.core.data.map.MogoLocation
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
@@ -40,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)
|
||||
@@ -92,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())
|
||||
}
|
||||
@@ -103,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")
|
||||
|
||||
@@ -645,9 +645,6 @@ class DebugSettingView @JvmOverloads constructor(
|
||||
//云端感知绘制
|
||||
tbDrawAiCloudFusion.setOnCheckedChangeListener { _, isChecked ->
|
||||
FunctionBuildConfig.isDrawAiCloudFusion = isChecked
|
||||
if (!FunctionBuildConfig.isDrawAiCloudFusion) {
|
||||
tbDrawAiCloudFusion.isChecked = false
|
||||
}
|
||||
}
|
||||
|
||||
tbDrawRomaMode.isChecked = FunctionBuildConfig.isRomaMode
|
||||
|
||||
@@ -103,21 +103,23 @@ class SOPSettingView @JvmOverloads constructor(
|
||||
* 限速数据来源开关
|
||||
*/
|
||||
tbRoadLimitSpeedSop.setOnCheckedChangeListener { _, isChecked ->
|
||||
//默认关闭
|
||||
//默认开启
|
||||
HmiBuildConfig.isShowObuLimitSpeedView = isChecked
|
||||
}
|
||||
|
||||
/**
|
||||
* obu V2V开关
|
||||
*/
|
||||
tbObuV2vView.isChecked = HmiBuildConfig.isShowObuV2vView
|
||||
tbObuV2vView.setOnCheckedChangeListener { _, isChecked ->
|
||||
//默认关闭
|
||||
//默认开启
|
||||
HmiBuildConfig.isShowObuV2vView = isChecked
|
||||
}
|
||||
|
||||
/**
|
||||
* obu V2i开关
|
||||
*/
|
||||
tbObuV2iView.isChecked = HmiBuildConfig.isShowObuV2iView
|
||||
tbObuV2iView.setOnCheckedChangeListener { _, isChecked ->
|
||||
//默认关闭
|
||||
HmiBuildConfig.isShowObuV2iView = isChecked
|
||||
|
||||
@@ -8,11 +8,14 @@ import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotStatusInfo
|
||||
import com.mogo.eagle.core.data.bindingcar.AdUpgradeStateHelper
|
||||
import com.mogo.eagle.core.data.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.bindingcar.IMoGoBindingCarListener
|
||||
import com.mogo.eagle.core.function.api.map.listener.IMoGoMapLocationListener
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager
|
||||
import com.mogo.eagle.core.function.call.bindingcar.CallerBindingCarListenerManager
|
||||
import com.mogo.eagle.core.function.call.bindingcar.CallerBindingcarManager
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapLocationListenerManager
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
import com.mogo.eagle.core.function.hmi.ui.map.OfflineMapDialog
|
||||
@@ -34,7 +37,8 @@ class SystemVersionView @JvmOverloads constructor(
|
||||
context: Context,
|
||||
attrs: AttributeSet? = null,
|
||||
defStyleAttr: Int = 0
|
||||
) : ConstraintLayout(context, attrs, defStyleAttr), IMoGoAutopilotStatusListener,IMoGoBindingCarListener {
|
||||
) : ConstraintLayout(context, attrs, defStyleAttr), IMoGoAutopilotStatusListener,
|
||||
IMoGoBindingCarListener, IMoGoMapLocationListener {
|
||||
|
||||
companion object {
|
||||
const val TAG = "SystemVersionView"
|
||||
@@ -44,14 +48,15 @@ class SystemVersionView @JvmOverloads constructor(
|
||||
private var dockerVersion: String? = null //工控机版本
|
||||
private var autopilotStatus: Int? = null //自动驾驶状态 0代表不可自动驾驶,1代表可自动驾驶,2代表自动驾驶中
|
||||
|
||||
private var ipcUpgradeStateInfo: IPCUpgradeStateInfo?=null
|
||||
private var ipcUpgradeStateInfo: IPCUpgradeStateInfo? = null
|
||||
|
||||
private var needQueryContainers: Boolean = false
|
||||
private var dockerList: List<String>?=null
|
||||
private var dockerList: List<String>? = null
|
||||
private var previousProgress: Int = -1 //前一秒的下载进度,用于计算下载剩余时间
|
||||
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)
|
||||
@@ -98,15 +103,16 @@ class SystemVersionView @JvmOverloads constructor(
|
||||
when {
|
||||
AdUpgradeStateHelper.isDownloading(it.status) -> {
|
||||
//下载中,点击Toast提示:下载剩余时间
|
||||
it.progress?.let { progress->
|
||||
progress.progressDetail?.let {progressDetail->
|
||||
if(AdUpgradeStateHelper.getRemainingTime(
|
||||
it.progress?.let { progress ->
|
||||
progress.progressDetail?.let { progressDetail ->
|
||||
if (AdUpgradeStateHelper.getRemainingTime(
|
||||
progressDetail.total,
|
||||
previousProgress,
|
||||
currentProgress
|
||||
).isEmpty()){
|
||||
).isEmpty()
|
||||
) {
|
||||
ToastUtils.showShort("下载已完成")
|
||||
}else{
|
||||
} else {
|
||||
ToastUtils.showShort(
|
||||
"预计" + AdUpgradeStateHelper.getRemainingTime(
|
||||
progressDetail.total,
|
||||
@@ -143,13 +149,23 @@ 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()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
updateHDDataCacheStatus(CallerMapUIServiceManager.isCityDataCached())
|
||||
|
||||
if(AdUpgradeStateHelper.isConfirmUpgrade()){
|
||||
if (AdUpgradeStateHelper.isConfirmUpgrade()) {
|
||||
//将角标改为“下载中”
|
||||
ivAdStatus?.setImageResource(R.drawable.icon_downloading)
|
||||
ivAdVersion?.setBackgroundResource(R.drawable.version_latest_background)
|
||||
@@ -165,7 +181,7 @@ class SystemVersionView @JvmOverloads constructor(
|
||||
private fun setAdUpgradeInfo(ipcUpgradeStateInfo: IPCUpgradeStateInfo) {
|
||||
this.previousProgress = this.currentProgress
|
||||
ipcUpgradeStateInfo.progress?.let {
|
||||
it.progressDetail?.let {progressDetail->
|
||||
it.progressDetail?.let { progressDetail ->
|
||||
this.currentProgress = progressDetail.current
|
||||
}
|
||||
}
|
||||
@@ -176,22 +192,22 @@ class SystemVersionView @JvmOverloads constructor(
|
||||
* 展示工控机下载、升级状态信息
|
||||
*
|
||||
*/
|
||||
fun showAdUpgradeStatus(ipcUpgradeStateInfo: IPCUpgradeStateInfo){
|
||||
ThreadUtils.runOnUiThread{
|
||||
fun showAdUpgradeStatus(ipcUpgradeStateInfo: IPCUpgradeStateInfo) {
|
||||
ThreadUtils.runOnUiThread {
|
||||
setAdUpgradeInfo(ipcUpgradeStateInfo)
|
||||
AdUpgradeStateHelper.setUpgradeableStatus(false)
|
||||
ipcUpgradeStateInfo.status.let {status->
|
||||
ipcUpgradeStateInfo.status.let { status ->
|
||||
when {
|
||||
AdUpgradeStateHelper.isDownloading(status) -> {
|
||||
//正在下载,展示“下载中”角标,展示进度条,并设置当前下载进度
|
||||
ivAdStatus?.setImageResource(R.drawable.icon_downloading)
|
||||
adCircularProgressView?.let {adCircularProgressView->
|
||||
adCircularProgressView?.let { adCircularProgressView ->
|
||||
adCircularProgressView.visibility = View.VISIBLE
|
||||
CallerLogger.i(
|
||||
"$M_HMI$$TAG", "showAdUpgradeStatus status=$status"
|
||||
)
|
||||
ipcUpgradeStateInfo.progress?.let { progress->
|
||||
progress.progressDetail?.let {progressDetail->
|
||||
ipcUpgradeStateInfo.progress?.let { progress ->
|
||||
progress.progressDetail?.let { progressDetail ->
|
||||
adCircularProgressView.setProgress(
|
||||
AdUpgradeStateHelper.downloadProgress(
|
||||
progressDetail.current,
|
||||
@@ -212,14 +228,14 @@ class SystemVersionView @JvmOverloads constructor(
|
||||
ivAdVersion?.setBackgroundResource(R.drawable.version_latest_background)
|
||||
AdUpgradeStateHelper.setConfirmUpgrade(false)
|
||||
}
|
||||
AdUpgradeStateHelper.isDownloadFinish(status) ->{
|
||||
AdUpgradeStateHelper.isDownloadFinish(status) -> {
|
||||
//升级中,将状态设为“升级中”角标,并隐藏进度条
|
||||
ivAdStatus?.setImageResource(R.drawable.icon_upgrading)
|
||||
adCircularProgressView?.visibility = View.GONE
|
||||
ivAdVersion?.setBackgroundResource(R.drawable.version_latest_background)
|
||||
AdUpgradeStateHelper.setConfirmUpgrade(false)
|
||||
}
|
||||
AdUpgradeStateHelper.isUpgrading(status) ->{
|
||||
AdUpgradeStateHelper.isUpgrading(status) -> {
|
||||
//升级中,将状态设为“升级中”角标,并隐藏进度条
|
||||
ivAdStatus?.setImageResource(R.drawable.icon_upgrading)
|
||||
adCircularProgressView?.visibility = View.GONE
|
||||
@@ -291,7 +307,8 @@ class SystemVersionView @JvmOverloads constructor(
|
||||
return
|
||||
}
|
||||
CallerAutoPilotStatusListenerManager.addListener(TAG, this)
|
||||
CallerBindingCarListenerManager.registerDevaToolsLogCatchListener(TAG,this)
|
||||
CallerBindingCarListenerManager.registerDevaToolsLogCatchListener(TAG, this)
|
||||
CallerMapLocationListenerManager.addListener(TAG, this, true)
|
||||
needQueryContainers = true
|
||||
}
|
||||
|
||||
@@ -302,6 +319,7 @@ class SystemVersionView @JvmOverloads constructor(
|
||||
}
|
||||
CallerAutoPilotStatusListenerManager.removeListener(TAG)
|
||||
CallerBindingCarListenerManager.unRegisterDevaToolsLogCatchListener(TAG)
|
||||
CallerMapLocationListenerManager.removeListener(TAG, true)
|
||||
needQueryContainers = false
|
||||
}
|
||||
|
||||
@@ -332,13 +350,13 @@ class SystemVersionView @JvmOverloads constructor(
|
||||
*/
|
||||
override fun queryContainersResponse(dockerList: List<String>) {
|
||||
this.dockerList = dockerList
|
||||
if(dockerList.isNotEmpty()){
|
||||
if (dockerList.isNotEmpty()) {
|
||||
//有更新任务,将状态设为“可升级”角标,并隐藏进度条
|
||||
ivAdStatus?.setImageResource(R.drawable.icon_upgradeable)
|
||||
adCircularProgressView?.visibility = View.GONE
|
||||
ivAdVersion?.setBackgroundResource(R.drawable.version_upgradeable_background)
|
||||
AdUpgradeStateHelper.setUpgradeableStatus(true)
|
||||
}else{
|
||||
} else {
|
||||
ToastUtils.showLong("已是最新版本")
|
||||
ivAdStatus?.setImageResource(R.drawable.icon_latest_version)
|
||||
adCircularProgressView?.visibility = View.GONE
|
||||
@@ -360,4 +378,7 @@ class SystemVersionView @JvmOverloads constructor(
|
||||
adCircularProgressView?.visibility = View.GONE
|
||||
}
|
||||
|
||||
override fun onLocationChanged(location: MogoLocation?, from: Int, isGps: Boolean) {
|
||||
this.location = location
|
||||
}
|
||||
}
|
||||
@@ -234,6 +234,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:text="路侧限速提醒"
|
||||
android:paddingTop="25dp"
|
||||
android:visibility="gone"
|
||||
android:paddingBottom="25dp"
|
||||
android:scaleY="1.2"
|
||||
android:scaleX="1.2"
|
||||
|
||||
@@ -59,6 +59,7 @@
|
||||
<string name="offline_download_success">离线地图下载成功</string>
|
||||
<string name="offline_download_failure">离线地图下载失败</string>
|
||||
<string name="offline_had_downloaded">当前已为最新版本</string>
|
||||
<string name="location_try_again">请检查定位是否正常</string>
|
||||
<string name="ok_tip">确定</string>
|
||||
<string name="retry">重试</string>
|
||||
</resources>
|
||||
|
||||
@@ -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
|
||||
@@ -48,6 +49,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
|
||||
}
|
||||
@@ -55,4 +60,8 @@ object CallerMapUIServiceManager {
|
||||
fun cancelDownloadCacheData() {
|
||||
serviceProvider?.mapUIController?.cancelDownloadCacheData()
|
||||
}
|
||||
|
||||
fun getCityCode(): String? {
|
||||
return serviceProvider?.mapUIController?.cityCode
|
||||
}
|
||||
}
|
||||
@@ -10,6 +10,7 @@ import androidx.annotation.RawRes;
|
||||
|
||||
import com.mogo.eagle.core.data.map.CenterLine;
|
||||
import com.mogo.eagle.core.data.map.MogoLatLng;
|
||||
import com.mogo.eagle.core.data.map.MogoLocation;
|
||||
import com.mogo.map.hdcache.IHdCacheListener;
|
||||
|
||||
import org.json.JSONObject;
|
||||
@@ -343,6 +344,8 @@ public interface IMogoMapUIController {
|
||||
|
||||
void cacheHDDataByCity(IHdCacheListener listener);
|
||||
|
||||
void cacheHDDataByCity(IHdCacheListener listener, MogoLocation location);
|
||||
|
||||
/**
|
||||
* 当前城市离线数据是否已缓存
|
||||
* @return
|
||||
@@ -350,4 +353,6 @@ public interface IMogoMapUIController {
|
||||
boolean isCityDataCached();
|
||||
|
||||
void cancelDownloadCacheData();
|
||||
|
||||
String getCityCode();
|
||||
}
|
||||
|
||||
@@ -49,7 +49,6 @@ dependencies {
|
||||
// 高精地图
|
||||
implementation rootProject.ext.dependencies.mogocustommap
|
||||
// 高德地图
|
||||
// api rootProject.ext.dependencies.amaplocation
|
||||
api rootProject.ext.dependencies.amapnavi3dmap
|
||||
|
||||
if (Boolean.valueOf(USE_MAVEN_PACKAGE)) {
|
||||
|
||||
@@ -395,7 +395,7 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
|
||||
@Override
|
||||
public void setRomaMode(int mode) {
|
||||
mMapView.getMapAutoViewHelper().setRoamStyle(mode,1800, MapAutoApi.ROAM_SPEED_40);
|
||||
mMapView.getMapAutoViewHelper().setRoamStyle(mode, 1800, MapAutoApi.ROAM_SPEED_40);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -448,7 +448,6 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @return true-是,false=不是
|
||||
*/
|
||||
private boolean isVrMold() {
|
||||
@@ -1219,6 +1218,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) {
|
||||
@@ -1244,4 +1281,9 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
mMapView.getMapAutoViewHelper().cancelCacheHDData();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getCityCode() {
|
||||
return GDLocationClient.getInstance(getContext()).getLastCityCode();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@ import android.view.View;
|
||||
|
||||
import com.mogo.eagle.core.data.map.CenterLine;
|
||||
import com.mogo.eagle.core.data.map.MogoLatLng;
|
||||
import com.mogo.eagle.core.data.map.MogoLocation;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.map.hdcache.IHdCacheListener;
|
||||
import com.mogo.map.uicontroller.CarCursorOption;
|
||||
@@ -451,6 +452,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) {
|
||||
@@ -465,4 +473,12 @@ public class MogoMapUIController implements IMogoMapUIController {
|
||||
mDelegate.cancelDownloadCacheData();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getCityCode() {
|
||||
if (mDelegate != null) {
|
||||
return mDelegate.getCityCode();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@ import android.view.View;
|
||||
|
||||
import com.mogo.eagle.core.data.map.CenterLine;
|
||||
import com.mogo.eagle.core.data.map.MogoLatLng;
|
||||
import com.mogo.eagle.core.data.map.MogoLocation;
|
||||
import com.mogo.map.hdcache.IHdCacheListener;
|
||||
import com.zhidaoauto.map.sdk.open.MapAutoApi;
|
||||
|
||||
@@ -384,6 +385,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) {
|
||||
@@ -398,4 +406,12 @@ public class AMapUIController implements IMogoMapUIController {
|
||||
mClient.cancelDownloadCacheData();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getCityCode() {
|
||||
if (mClient != null) {
|
||||
return mClient.getCityCode();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user