diff --git a/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/fragment/BaseBusTabFragment.java b/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/fragment/BaseBusTabFragment.java index e0775f569f..24743f06cd 100644 --- a/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/fragment/BaseBusTabFragment.java +++ b/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/fragment/BaseBusTabFragment.java @@ -142,11 +142,11 @@ public abstract class BaseBusTabFragment if (controller != null) { //切换地图的远近视图 if (controller.getCurrentMapVisualAngle().isLongSight()) { - Objects.requireNonNull(CallerMapUIServiceManager.INSTANCE.getMapUIController()).setLockMode(true); + //Objects.requireNonNull(CallerMapUIServiceManager.INSTANCE.getMapUIController()).setLockMode(true); controller.changeMapVisualAngle(VisualAngleMode.MODE_MEDIUM_SIGHT, null); mSwitchMapModeImage.setImageResource(R.drawable.bus_switch_map_medium); } else if (controller.getCurrentMapVisualAngle().isMediumSight()) { - Objects.requireNonNull(CallerMapUIServiceManager.INSTANCE.getMapUIController()).setLockMode(false); + //Objects.requireNonNull(CallerMapUIServiceManager.INSTANCE.getMapUIController()).setLockMode(false); controller.changeMapVisualAngle(VisualAngleMode.MODE_LONG_SIGHT, null); mSwitchMapModeImage.setImageResource(R.drawable.bus_switch_map_long); } else { diff --git a/OCH/mogo-och-charter/src/main/java/com/magic/mogo/och/charter/base/CharterBaseFragment.kt b/OCH/mogo-och-charter/src/main/java/com/magic/mogo/och/charter/base/CharterBaseFragment.kt index 96bc9a4150..67a69707df 100644 --- a/OCH/mogo-och-charter/src/main/java/com/magic/mogo/och/charter/base/CharterBaseFragment.kt +++ b/OCH/mogo-och-charter/src/main/java/com/magic/mogo/och/charter/base/CharterBaseFragment.kt @@ -109,13 +109,13 @@ abstract class CharterBaseFragment?>() : if (controller != null) { //切换地图的远近视图 if (controller.currentMapVisualAngle.isLongSight) { - Objects.requireNonNull(getMapUIController()) - ?.setLockMode(true) + //Objects.requireNonNull(getMapUIController()) + // ?.setLockMode(true) controller.changeMapVisualAngle(VisualAngleMode.MODE_MEDIUM_SIGHT, null) mSwitchMapModeImage!!.setImageResource(R.drawable.bus_switch_map_medium) } else if (controller.currentMapVisualAngle.isMediumSight) { - Objects.requireNonNull(getMapUIController()) - ?.setLockMode(false) + //Objects.requireNonNull(getMapUIController()) + // ?.setLockMode(false) controller.changeMapVisualAngle(VisualAngleMode.MODE_LONG_SIGHT, null) mSwitchMapModeImage!!.setImageResource(R.drawable.bus_switch_map_long) } else { diff --git a/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/manager/distancemamager/DistanceDegree.kt b/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/manager/distancemamager/DistanceDegree.kt index 205510c9da..bc30038358 100644 --- a/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/manager/distancemamager/DistanceDegree.kt +++ b/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/manager/distancemamager/DistanceDegree.kt @@ -1,13 +1,54 @@ package com.mogo.och.common.module.manager.distancemamager -data class DistanceDegree(var distance:Float,var degree:Double?,var isNext:Boolean?):Comparable{ +data class DistanceDegree(var distance: Float, var degree: Double?, var isNext: Boolean?) : + Comparable { override fun compareTo(other: DistanceDegree): Int { // 对比距离 - if(distance == other.distance){ + if (distance == other.distance) { return 0; - } else if(distance < other.distance){ + } else if (distance < other.distance) { return -1; } return 1; } + + var next: DistanceDegree? = null + + fun recycle() { + synchronized(sPoolSync) { + if (sPoolSize < MAX_POOL_SIZE) { + next = sPool + sPool = this + sPoolSize++ + } + //Logger.d("DistanceDegree","缓存对象个数${sPoolSize}个") + } + } + + companion object { + var sPoolSync = Any() + private var sPool: DistanceDegree? = null + private var sPoolSize = 0 + private var MAX_POOL_SIZE = 20 + + + fun obtain(distance: Float, degree: Double?, isNext: Boolean?): DistanceDegree { + synchronized(sPoolSync) { + if (sPool != null) { + val m: DistanceDegree = sPool!! + sPool = m.next + m.next = null + m.distance = distance + m.degree = degree + m.isNext = isNext + sPoolSize-- + //Logger.d("DistanceDegree","取出一个对象个数${sPoolSize}个") + return m + } + //Logger.d("DistanceDegree","创建一个对象 ${sPoolSize}个") + return DistanceDegree(distance, degree, isNext) + } + } + } + } diff --git a/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/utils/CoordinateCalculateRouteUtil.kt b/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/utils/CoordinateCalculateRouteUtil.kt index 79444f76f5..164681283a 100644 --- a/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/utils/CoordinateCalculateRouteUtil.kt +++ b/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/utils/CoordinateCalculateRouteUtil.kt @@ -601,6 +601,7 @@ object CoordinateCalculateRouteUtil { type:Int, size:Int = 4 ): Triple { + val startTime = System.currentTimeMillis() Logger.d(SceneConstant.M_OCHCOMMON + "calculateRouteSumLength", "参数:[$preIndex $endIndex) mRoutePoints:${mRoutePoints.size} type:$type size:$size" + " location:(${location.latitude},${location.longitude},${location.heading})") @@ -615,9 +616,9 @@ object CoordinateCalculateRouteUtil { latLngIndex.longitude, latLngIndex.latitude ) - distanceMap[DistanceDegree(distance, null,null)] = index + distanceMap[DistanceDegree.obtain(distance, null,null)] = index if (distanceMap.size > size) { - distanceMap.pollLastEntry() + distanceMap.pollLastEntry()?.key?.recycle() } } distanceMap.forEach { @@ -687,6 +688,12 @@ object CoordinateCalculateRouteUtil { // 通过航向角过滤一遍 if(distanceDegree.degree!=null&&DrivingDirectionUtils.getAngleDiff(location.heading, distanceDegree.degree!!)<90){ currentIndex = pointIndex + val iterator1 = distanceMap.iterator() + while (iterator1.hasNext()) { + iterator1.next().key.recycle() + iterator1.remove() + } + distanceMap.clear() return Triple(currentIndex,distanceDegree.isNext,distanceDegree.distance) } } @@ -701,12 +708,14 @@ object CoordinateCalculateRouteUtil { val next = iterator.next() val key = next.key if (key.degree == null) { + key.recycle() iterator.remove() } else { if (location.heading != 0.0) { key.degree?.let { val dexAngle = DrivingDirectionUtils.getAngleDiff(location.heading, it) if (dexAngle > 90) { + key.recycle() iterator.remove() } } @@ -715,6 +724,14 @@ object CoordinateCalculateRouteUtil { } if(distanceMap.size==0&&size<16){ + val iterator1 = distanceMap.iterator() + while (iterator1.hasNext()) { + iterator1.next().key.recycle() + iterator1.remove() + } + distanceMap.clear() + Logger.d(SceneConstant.M_OCHCOMMON + "calculateRouteSumLength", + "计算时间:${startTime-System.currentTimeMillis()}") return getNearestPointInfo(preIndex,endIndex,mRoutePoints,location,type,size+2) } @@ -734,9 +751,25 @@ object CoordinateCalculateRouteUtil { if(preIndexDistance!=null&&preIndexNextDistance!=null){ if(preIndexDistance!!.distancemiddleVale){ + key.recycle() iteratorRemove.remove() } } @@ -773,6 +807,7 @@ object CoordinateCalculateRouteUtil { val next = iteratorRemove.next() val key = next.key if(next.value if (controller != null) { //切换地图的远近视图 if (controller.getCurrentMapVisualAngle().isLongSight()) { - Objects.requireNonNull(CallerMapUIServiceManager.INSTANCE.getMapUIController()).setLockMode(true); + //Objects.requireNonNull(CallerMapUIServiceManager.INSTANCE.getMapUIController()).setLockMode(true); controller.changeMapVisualAngle(VisualAngleMode.MODE_MEDIUM_SIGHT, null); mSwitchMapModeImage.setImageResource(R.drawable.bus_switch_map_medium); } else if (controller.getCurrentMapVisualAngle().isMediumSight()) { - Objects.requireNonNull(CallerMapUIServiceManager.INSTANCE.getMapUIController()).setLockMode(false); + //Objects.requireNonNull(CallerMapUIServiceManager.INSTANCE.getMapUIController()).setLockMode(false); controller.changeMapVisualAngle(VisualAngleMode.MODE_LONG_SIGHT, null); mSwitchMapModeImage.setImageResource(R.drawable.bus_switch_map_long); } else { diff --git a/OCH/taxi/mogo-och-taxi-passenger/src/main/res/layout/taxi_p_start_autopilot_view.xml b/OCH/taxi/mogo-och-taxi-passenger/src/main/res/layout/taxi_p_start_autopilot_view.xml index 8390992694..5969d33c65 100644 --- a/OCH/taxi/mogo-och-taxi-passenger/src/main/res/layout/taxi_p_start_autopilot_view.xml +++ b/OCH/taxi/mogo-och-taxi-passenger/src/main/res/layout/taxi_p_start_autopilot_view.xml @@ -155,12 +155,20 @@ android:layout_width="wrap_content" android:layout_height="wrap_content"/> + + + - + - + + + + () + msgEventParams[EVENT_PARAMS_POI_TYPE] = poiType //事件类型 + msgEventParams[EVENT_PARAMS_CONTENT] = content?:"" //事件内容 + msgEventParams[EVENT_PARAMS_TTS_CONTENT] = ttsContent?:"" //语音播报内容 + msgEventParams[EVENT_PARAMS_DISPLAY_TIME] = DateTimeUtils.getTimeText( + System.currentTimeMillis(), DateTimeUtils.yyyy_MM_dd_HH_mm_ss) //展示时间 + msgEventParams[EVENT_PARAMS_DATA_SOURCE] = dataSource.name //数据来源 + msgEventParams[EVENT_PARAMS_COMMUNICATION_TYPE] = communicationType.name //通信类型 + msgEventParams[EVENT_PARAMS_PLATE_NUMBER] = AppConfigInfo.plateNumber //车牌号 + msgEventParams[EVENT_PARAMS_CAR_SN] = MoGoAiCloudClientConfig.getInstance().sn //鹰眼SN + msgEventParams[EVENT_PARAMS_EYE_VERSION] = AppUtils.getAppVersionName() //鹰眼版本 + msgEventParams[EVENT_PARAMS_LONGITUDE] = "$longitude" //经度 + msgEventParams[EVENT_PARAMS_LATITUDE] = "$latitude" //纬度 + msgEventParams[EVENT_PARAMS_HEADING] = "$heading" //航向角 + MogoAnalyticUtils.track(EVENT_KEY_RECEIVE_V2X_MSG,msgEventParams) + } + + /** + * 触发V2X消息埋点(播报事件) */ fun triggerV2XEvent(poiType: String,content: String?,ttsContent: String?, dataSource: DataSourceType,communicationType: CommunicationType){ diff --git a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/smp/view/SmallMapView.kt b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/smp/view/SmallMapView.kt index fa6fa59c1d..be0d0053d7 100644 --- a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/smp/view/SmallMapView.kt +++ b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/smp/view/SmallMapView.kt @@ -325,6 +325,9 @@ class SmallMapView @JvmOverloads constructor( super.onAutopilotRouteLineId(lineId) if(lineId == 0L){ this.globalPathResp = null + UiThreadHandler.post { + clearPolyline() + } } } diff --git a/gradle.properties b/gradle.properties index 5d3accc1f6..ba91c0dbeb 100644 --- a/gradle.properties +++ b/gradle.properties @@ -85,7 +85,7 @@ MOGO_LOCATION_VERSION=1.4.7.12 MOGO_TELEMATIC_VERSION=1.4.7.12 ######## MogoAiCloudSDK Version ######## # 自研地图 -MAP_SDK_VERSION=2.14.1.5 +MAP_SDK_VERSION=2.14.2.8 MAP_SDK_OPERATION_VERSION=1.1.4.1 # websocket WEBSOCKET_VERSION=1.1.7