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 79a0f790ff..045f9e9e3c 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 @@ -1,5 +1,6 @@ package com.mogo.eagle.core.function.call.autopilot +import android.util.Log import androidx.annotation.Nullable import com.mogo.eagle.core.data.autopilot.AutopilotCarStateInfo import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotCarStateListener @@ -17,7 +18,7 @@ object CallerAutopilotCarStatusListenerManager : CallerBase() { // 存储所有注册了监听的对象,invokeXXXX进行遍历回调,将信息同步 private val M_AUTOPILOT_STATUS_LISTENERS: ConcurrentHashMap = - ConcurrentHashMap() + ConcurrentHashMap() /** @@ -26,8 +27,8 @@ object CallerAutopilotCarStatusListenerManager : CallerBase() { * @param listener 监听回调 */ fun addListener( - @Nullable tag: String, - @Nullable listener: IMoGoAutopilotCarStateListener + @Nullable tag: String, + @Nullable listener: IMoGoAutopilotCarStateListener ) { if (M_AUTOPILOT_STATUS_LISTENERS.containsKey(tag)) { LogUtils.eTag(TAG, "Tag:$tag already exists,please use other tag") @@ -67,6 +68,7 @@ object CallerAutopilotCarStatusListenerManager : CallerBase() { @Synchronized fun invokeAutopilotCarStateData(autoPilotCarStateInfo: AutopilotCarStateInfo?) { //LogUtils.dTag(TAG, "$autoPilotCarStateInfo") + //Log.w("DHY-location", "${autoPilotCarStateInfo?.values?.lon},${autoPilotCarStateInfo?.values?.lat} CallerAutopilotCarStatusListenerManager-invokeAutopilotCarStateData") M_AUTOPILOT_STATUS_LISTENERS.forEach { val tag = it.key val listener = it.value diff --git a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/map/CallerMapLocationListenerManager.kt b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/map/CallerMapLocationListenerManager.kt index 71cab938a2..fcbb46228a 100644 --- a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/map/CallerMapLocationListenerManager.kt +++ b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/map/CallerMapLocationListenerManager.kt @@ -1,5 +1,6 @@ package com.mogo.eagle.core.function.call.map +import android.util.Log import androidx.annotation.Nullable import com.mogo.eagle.core.data.map.MogoLocation import com.mogo.eagle.core.function.api.map.listener.IMoGoMapLocationListener @@ -87,6 +88,7 @@ object CallerMapLocationListenerManager : CallerBase() { */ fun invokeMapLocationChangeListener(location: MogoLocation?) { //LogUtils.dTag(TAG, "mapStyleMode:$location") + Log.w("DHY-location", "${location?.longitude},${location?.latitude} CallerMapLocationListenerManager-invokeMapLocationChangeListener") mLocation = location mMapStyleChangeListeners.forEach { val tag = it.key diff --git a/libraries/map-custom/src/main/java/com/mogo/map/impl/custom/AMapViewWrapper.java b/libraries/map-custom/src/main/java/com/mogo/map/impl/custom/AMapViewWrapper.java index 24d223f968..4d2703d868 100644 --- a/libraries/map-custom/src/main/java/com/mogo/map/impl/custom/AMapViewWrapper.java +++ b/libraries/map-custom/src/main/java/com/mogo/map/impl/custom/AMapViewWrapper.java @@ -29,6 +29,7 @@ import com.mogo.eagle.core.function.call.map.CallerLocationUpdaterManager; import com.mogo.eagle.core.function.call.map.CallerMapLocationListenerManager; import com.mogo.eagle.core.function.call.map.CallerMapStyleListenerManager; import com.mogo.eagle.core.utilcode.mogo.toast.TipToast; +import com.mogo.eagle.core.utilcode.util.GsonUtils; import com.mogo.map.IMogoMap; import com.mogo.map.IMogoMapView; import com.mogo.map.impl.custom.navi.NaviClient; @@ -750,6 +751,7 @@ public class AMapViewWrapper implements IMogoMapView, @Override public void onLocationChanged(@NotNull com.zhidaoauto.map.sdk.open.location.MogoLocation location) { + Log.w("DHY-location", location.getLon() + "," + location.getLat() + " AMapViewWrapper-onLocationChanged:"); MogoLocation mLastLocation = ObjectUtils.fromLocation(location); UiThreadHandler.post(() -> CallerMapLocationListenerManager.INSTANCE.invokeMapLocationChangeListener(mLastLocation)); @@ -788,7 +790,7 @@ public class AMapViewWrapper implements IMogoMapView, } else { mIsFirstLocated = true; mIsDelayed = false; - Logger.d(TAG, "同步定位"); + Logger.d(TAG, "同步定位:" + GsonUtils.toJson(location)); MapStyleController.getInstance().onLocationChanged(location, this); } } @@ -797,8 +799,8 @@ public class AMapViewWrapper implements IMogoMapView, try { mSelfMarker = mMapView.getMapAutoViewHelper().getMyLocationStyle().getSelfMarker(); mSelfMarker.setInfoWindowEnable(true); - } catch (Exception e) { + e.printStackTrace(); } } else { // 通过不同的方向类型来改变车模,目前暂定三种模型,drawlevel 1 绿,2 黄,3 红,绿色的时候需要把相应的切换为默认模型 diff --git a/libraries/map-custom/src/main/java/com/mogo/map/impl/custom/location/ALocationClient.java b/libraries/map-custom/src/main/java/com/mogo/map/impl/custom/location/ALocationClient.java index 6e00a0fd97..fce687b201 100644 --- a/libraries/map-custom/src/main/java/com/mogo/map/impl/custom/location/ALocationClient.java +++ b/libraries/map-custom/src/main/java/com/mogo/map/impl/custom/location/ALocationClient.java @@ -2,6 +2,7 @@ package com.mogo.map.impl.custom.location; import android.content.Context; import android.os.Trace; +import android.util.Log; import com.mogo.eagle.core.function.call.map.CallerMapLocationListenerManager; import com.mogo.map.impl.custom.utils.ObjectUtils; @@ -113,6 +114,7 @@ public class ALocationClient implements IMogoLocationClient { @Override public void onLocationChanged( @NotNull com.zhidaoauto.map.sdk.open.location.MogoLocation location ) { + Log.w("DHY-location", location.getLon() + "," + location.getLat() + " ALocationClient-onLocationChanged"); if ( mIsDestroyed ) { destroyWarming(); return; diff --git a/modules/mogo-module-adas/src/main/java/com/mogo/module/adas/OnAdasListenerAdapter.java b/modules/mogo-module-adas/src/main/java/com/mogo/module/adas/OnAdasListenerAdapter.java index 3cdab38a1d..3e8a93fab4 100644 --- a/modules/mogo-module-adas/src/main/java/com/mogo/module/adas/OnAdasListenerAdapter.java +++ b/modules/mogo-module-adas/src/main/java/com/mogo/module/adas/OnAdasListenerAdapter.java @@ -2,7 +2,6 @@ package com.mogo.module.adas; import android.util.Log; -import com.mogo.commons.AbsMogoApplication; import com.mogo.eagle.core.data.autopilot.ADASTrajectoryInfo; import com.mogo.eagle.core.data.autopilot.AutopilotCarStateInfo; import com.mogo.eagle.core.data.autopilot.AutopilotGuardianStatusInfo; @@ -10,14 +9,12 @@ import com.mogo.eagle.core.data.autopilot.AutopilotRouteInfo; import com.mogo.eagle.core.data.autopilot.AutopilotStationInfo; import com.mogo.eagle.core.data.autopilot.AutopilotStatusInfo; import com.mogo.eagle.core.data.autopilot.AutopilotWarnMessage; -import com.mogo.eagle.core.data.constants.MoGoConfig; import com.mogo.eagle.core.data.traffic.TrafficData; import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager; import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotCarStatusListenerManager; import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotIdentifyListenerManager; import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotPlanningListenerManager; import com.mogo.utils.logger.Logger; -import com.mogo.utils.storage.SharedPrefsMgr; import com.zhidao.support.adas.high.AdasManager; import com.zhidao.support.adas.high.OnAdasListener; import com.zhidao.support.adas.high.bean.AutopilotRoute; @@ -45,7 +42,7 @@ import java.util.List; public class OnAdasListenerAdapter implements OnAdasListener { private final String TAG = "OnAdasListenerAdapter"; - + @Override public void onRectData(RectInfo rectInfo) { ArrayList recognizedListResults = AdasObjectUtils.INSTANCE.regroupTrafficDataData(rectInfo.getModels()); @@ -56,10 +53,10 @@ public class OnAdasListenerAdapter implements OnAdasListener { @Override public void onCarStateData(CarStateInfo carStateInfo) { Logger.d(TAG, "--------carStateInfo.toString() = " + carStateInfo.toString()); - AutopilotCarStateInfo autopilotCarStateInfo = AdasObjectUtils.INSTANCE.fromAdasCarStateInfoObject(carStateInfo); - CallerAutopilotCarStatusListenerManager.INSTANCE.invokeAutopilotCarStateData(autopilotCarStateInfo); //can数据转发 CarStateInfo.ValuesBean bean = carStateInfo.getValues(); + Log.w("DHY-location", bean.getLon() + "," + bean.getLat() + " OnAdasListenerAdapter-onCarStateData:"); + if (bean != null) { int turn_light = bean.getTurn_light(); //转向灯状态 0是正常 1是左转 2是右转 Logger.d(TAG, "onCarStateData ---- turn_light = " + turn_light); @@ -67,6 +64,9 @@ public class OnAdasListenerAdapter implements OnAdasListener { } else { Logger.e(TAG, "bean == null "); } + + AutopilotCarStateInfo autopilotCarStateInfo = AdasObjectUtils.INSTANCE.fromAdasCarStateInfoObject(carStateInfo); + CallerAutopilotCarStatusListenerManager.INSTANCE.invokeAutopilotCarStateData(autopilotCarStateInfo); } @Override