diff --git a/.idea/gradle.xml b/.idea/gradle.xml index 8bc2337f09..97a9cb7d46 100644 --- a/.idea/gradle.xml +++ b/.idea/gradle.xml @@ -4,7 +4,7 @@ diff --git a/app/src/main/java/com/mogo/launcher/MogoApplication.java b/app/src/main/java/com/mogo/launcher/MogoApplication.java index b3f19102fa..24b6bc4104 100644 --- a/app/src/main/java/com/mogo/launcher/MogoApplication.java +++ b/app/src/main/java/com/mogo/launcher/MogoApplication.java @@ -19,6 +19,7 @@ import com.mogo.commons.constants.SharedPrefsConstants; import com.mogo.commons.debug.DebugConfig; import com.mogo.commons.network.Utils; import com.mogo.eagle.core.data.constants.MogoServicePaths; +import com.mogo.map.MapApiPath; import com.mogo.map.location.MogoLocation; import com.mogo.module.authorize.authprovider.invoke.AuthorizeConstant; import com.mogo.module.carchatting.card.CallChatConstant; @@ -275,6 +276,7 @@ public class MogoApplication extends AbsMogoApplication { MogoModulePaths.addModule(new MogoModule(LeftPanelConst.PATH_NAME, LeftPanelConst.MODULE_NAME)); + MogoModulePaths.addBaseModule(new MogoModule(MapApiPath.PATH, "CustomMapApiBuilder")); MogoModulePaths.addBaseModule(new MogoModule(ServiceConst.PATH_TTS_CONFIG, ServiceConst.PATH_TTS_CONFIG)); MogoModulePaths.addBaseModule(new MogoModule(ShareConstants.TAG, ShareConstants.MODEL_NAME)); MogoModulePaths.addBaseModule(new MogoModule(MogoServicePaths.PATH_TANLU_API, "TanluApi")); diff --git a/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/traffic/TrafficData.kt b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/traffic/TrafficData.kt index 5f8937bfb2..b57be53aff 100644 --- a/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/traffic/TrafficData.kt +++ b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/traffic/TrafficData.kt @@ -83,4 +83,9 @@ class TrafficData { * 0x03: 警告 -- 红 */ var threatLevel = 0 + + override fun toString(): String { + return "TrafficData(type=$type, uuid='$uuid', carId='$carId', dataAccuracy=$dataAccuracy, lat=$lat, lon=$lon, heading=$heading, systemTime=$systemTime, satelliteTime=$satelliteTime, alt=$alt, speed=$speed, mortonCode=$mortonCode, distance=$distance, threatLevel=$threatLevel)" + } + } \ No newline at end of file diff --git a/modules/mogo-module-adas/src/main/java/com/mogo/module/adas/AdasObjectUtils.kt b/modules/mogo-module-adas/src/main/java/com/mogo/module/adas/AdasObjectUtils.kt index 592222d186..32302a6663 100644 --- a/modules/mogo-module-adas/src/main/java/com/mogo/module/adas/AdasObjectUtils.kt +++ b/modules/mogo-module-adas/src/main/java/com/mogo/module/adas/AdasObjectUtils.kt @@ -1,10 +1,10 @@ package com.mogo.module.adas import android.util.Log -import com.mogo.eagle.core.data.autopilot.AutopilotWarnMessage import com.mogo.eagle.core.data.autopilot.AutopilotCarStateInfo import com.mogo.eagle.core.data.autopilot.AutopilotGuardianStatusInfo import com.mogo.eagle.core.data.autopilot.AutopilotRouteInfo +import com.mogo.eagle.core.data.autopilot.AutopilotWarnMessage import com.mogo.eagle.core.data.enums.TrafficTypeEnum import com.mogo.eagle.core.data.traffic.TrafficData import com.mogo.utils.network.utils.GsonUtil @@ -14,7 +14,6 @@ import com.zhidao.support.adas.high.bean.RectInfo.RectBean import com.zhidao.support.adas.high.bean.WarnMessageInfo import com.zhidao.support.adas.high.bean.guardian.AutopilotGuardianInfo import java.util.* -import java.util.concurrent.TimeUnit /** * @author congtaowang @@ -23,6 +22,7 @@ import java.util.concurrent.TimeUnit * 对象转换类 */ object AdasObjectUtils { + val TAG = "AdasObjectUtils" fun fromAutopilotGuardianInfo(autopilotGuardianInfo: AutopilotGuardianInfo): AutopilotGuardianStatusInfo? { return GsonUtil.objectFromJson( @@ -83,7 +83,6 @@ object AdasObjectUtils { if (model == null) { return null } - val start = System.nanoTime() val result = TrafficData() result.uuid = model.uuid result.lat = model.lat @@ -98,11 +97,8 @@ object AdasObjectUtils { result.dataAccuracy = model.dataAccuracy result.distance = model.distance result.threatLevel = model.drawlevel - Log.d( - "ADAS数据延时", "fromAdasObject cost : " + TimeUnit.NANOSECONDS.toMillis( - System.nanoTime() - start - ) - ) + + Log.d(TAG, "TrafficData = $result") return result } diff --git a/modules/mogo-module-common/src/main/java/com/mogo/module/common/drawer/BaseDrawer.java b/modules/mogo-module-common/src/main/java/com/mogo/module/common/drawer/BaseDrawer.java index cd5756d753..3d060ceb93 100644 --- a/modules/mogo-module-common/src/main/java/com/mogo/module/common/drawer/BaseDrawer.java +++ b/modules/mogo-module-common/src/main/java/com/mogo/module/common/drawer/BaseDrawer.java @@ -37,7 +37,9 @@ import java.util.concurrent.ConcurrentHashMap; */ public class BaseDrawer { - // 移除过期的 marker + /** + * 移除过期的 marker + */ public static final int MSG_REMOVE_DIRTY_MARKERS = 9990; /** @@ -126,8 +128,8 @@ public class BaseDrawer { } } - private static void showSpeed(SpeedData speedData) { - showSelfSpeed(speedData.getMarker() + public static void showSpeed(SpeedData speedData) { + showIdentitySpeed(speedData.getMarker() , speedData.getSpeed() , speedData.getUuid() , speedData.getType() @@ -324,7 +326,8 @@ public class BaseDrawer { * @param speed 是否显示速度 * @param isVrMode 是否是vrMode */ - public static void showSelfSpeed(IMogoMarker mogoMarker, double speed, String uuid, int type, double heading, boolean isVrMode) { + public static void showIdentitySpeed(IMogoMarker mogoMarker, double speed, String uuid, + int type, double heading, boolean isVrMode) { Log.d("EmArrow", "showSelf uuid : " + uuid + " speed : " + speed); if (mogoMarker == null || mogoMarker.isDestroyed()) { return; @@ -334,13 +337,11 @@ public class BaseDrawer { return; } int speedIntVal = (int) (speed * 3.6); - if (speedIntVal <= 0) { //速度为0 隐藏InfoWindow - mogoMarker.hideInfoWindow(); - return; - } mogoMarker.setInfoWindowOffset(0, 20); - // String text = "speed : " + speedIntVal + "\n" + uuid + "\n" + "type : " + type + "\n" + "heading : " + heading; - String text = uuid + " , " + (int) heading; + String text = "uuid : " + uuid + "\n" + + "speed : " + speedIntVal + "\n" + + "type : " + type + "\n" + + "heading : " + heading; mSpeedView.setText(text); mogoMarker.updateInfoWindowView(mSpeedView); } diff --git a/modules/mogo-module-common/src/main/java/com/mogo/module/common/drawer/IdentifyDataDrawer.java b/modules/mogo-module-common/src/main/java/com/mogo/module/common/drawer/IdentifyDataDrawer.java index ef378ed013..1ade18dd00 100644 --- a/modules/mogo-module-common/src/main/java/com/mogo/module/common/drawer/IdentifyDataDrawer.java +++ b/modules/mogo-module-common/src/main/java/com/mogo/module/common/drawer/IdentifyDataDrawer.java @@ -2,7 +2,6 @@ package com.mogo.module.common.drawer; import static com.mogo.cloud.socket.entity.SocketDownDataHelper.FROM_ADAS; -import android.os.Message; import android.text.TextUtils; import android.util.Log; @@ -13,7 +12,6 @@ import com.mogo.map.marker.IMogoMarker; import com.mogo.map.marker.MogoMarkerOptions; import com.mogo.module.common.MogoApisHandler; import com.mogo.module.common.constants.DataTypes; -import com.mogo.module.common.drawer.bean.SpeedData; import java.util.ArrayList; import java.util.Iterator; @@ -206,6 +204,17 @@ public class IdentifyDataDrawer extends BaseDrawer { marker.setAnchorColor(carColor); newAdasRecognizedMarkersCaches.put(uniqueKey, marker); + + // 显示目标车的信息,但是数据多的时候会导致崩溃,不建议打开 +// if (shouldShowSpeed(recognizedListResult.getType().getType())) { +// SpeedData speedData = new SpeedData(marker +// , recognizedListResult.getSpeed() +// , recognizedListResult.getUuid() +// , recognizedListResult.getType().getType() +// , recognizedListResult.getHeading() +// , MogoApisHandler.getInstance().getApis().getStatusManagerApi().isVrMode()); +// showSpeed(speedData); +// } } /** diff --git a/modules/mogo-module-extensions/src/main/java/com/mogo/module/extensions/live/ExtensionServiceManager.java b/modules/mogo-module-extensions/src/main/java/com/mogo/module/extensions/live/ExtensionServiceManager.java index 9e9de0424e..7388ed8a5b 100644 --- a/modules/mogo-module-extensions/src/main/java/com/mogo/module/extensions/live/ExtensionServiceManager.java +++ b/modules/mogo-module-extensions/src/main/java/com/mogo/module/extensions/live/ExtensionServiceManager.java @@ -2,68 +2,18 @@ package com.mogo.module.extensions.live; import android.content.Context; -import com.mogo.map.location.IMogoLocationClient; -import com.mogo.map.marker.IMogoMarkerManager; import com.mogo.map.navi.IMogoNavi; -import com.mogo.map.overlay.IMogoOverlayManager; -import com.mogo.map.search.geo.IMogoGeoSearch; -import com.mogo.map.uicontroller.IMogoMapUIController; import com.mogo.module.common.MogoApisHandler; import com.mogo.service.IMogoServiceApis; -import com.mogo.service.analytics.IMogoAnalytics; -import com.mogo.service.cloud.socket.IMogoSocketManager; -import com.mogo.service.entrance.IMogoEntranceButtonController; -import com.mogo.service.eventpanel.IEventPanelProvider; -import com.mogo.service.imageloader.IMogoImageloader; -import com.mogo.service.intent.IMogoIntentManager; import com.mogo.service.map.IMogoMapService; -import com.mogo.service.module.IMogoActionManager; -import com.mogo.service.module.IMogoMarkerService; -import com.mogo.service.module.IMogoRegisterCenter; -import com.mogo.service.module.IMogoSearchManager; -import com.mogo.service.share.IMogoShareManager; -import com.mogo.service.share.IMogoTanluProvider; -import com.mogo.service.share.IMogoTrafficUploadProvider; -import com.mogo.service.statusmanager.IMogoStatusManager; -import com.mogo.service.strategy.IMogoOnlineCarListPanelProvider; -import com.mogo.service.strategy.IMogoRefreshStrategyController; -import com.mogo.service.windowview.IMogoTopViewManager; -import com.mogo.service.windowview.IMogoWindowManager; public class ExtensionServiceManager { private static boolean isInit; private static Context mContext; private static IMogoServiceApis mMogoServiceApis; - private static IMogoMapService mMapService; - private static IMogoMarkerManager mMarkerManager; private static IMogoNavi mNavi; - private static IMogoMapUIController mMapUIController; - private static IMogoLocationClient mMogoLocationClient; - private static IMogoGeoSearch mIMogoGeoSearch; - private static IMogoSearchManager mIMogoSearchManager; - private static IMogoTopViewManager mMogoTopViewManager; - private static IMogoStatusManager mMogoStatusManager; - private static IMogoWindowManager mIMogoWindowManager; - private static IMogoImageloader mImageLoader; - private static IMogoSocketManager mMogoSocketManager; - private static IMogoAnalytics mMogoAnalytics; - private static IMogoOverlayManager mMogoOverlayManager; - private static IMogoRegisterCenter mMogoRegisterCenter; - private static IMogoRefreshStrategyController mIMogoRefreshStrategyController; - private static IMogoMarkerService mIMogoMarkerService; - private static IMogoShareManager mIMogoShareManager; - private static IMogoTanluProvider mIMogoTanluProvider; - private static IMogoTrafficUploadProvider mIMogoTrafficUploadProvider; - //事件面板 - private static IEventPanelProvider mIEventPanelProvider; - - private static IMogoActionManager mMogoActionManager; - private static IMogoIntentManager mMogoIntentManager; - private static IMogoEntranceButtonController mMogoEntranceButtonController; - private static IMogoOnlineCarListPanelProvider mMogoOnlineCarListPanelProvider; - private ExtensionServiceManager() { @@ -72,38 +22,11 @@ public class ExtensionServiceManager { public static void init(final Context context) { if (!isInit) { isInit = true; - mContext = context; mMogoServiceApis = MogoApisHandler.getInstance().getApis(); mMapService = mMogoServiceApis.getMapServiceApi(); - mImageLoader = mMogoServiceApis.getImageLoaderApi(); - mMogoStatusManager = mMogoServiceApis.getStatusManagerApi(); - mMogoSocketManager = mMogoServiceApis.getSocketManagerApi(context); - mMogoAnalytics = mMogoServiceApis.getAnalyticsApi(); - mIMogoWindowManager = mMogoServiceApis.getWindowManagerApi(); - mMogoRegisterCenter = mMogoServiceApis.getRegisterCenterApi(); - mIMogoRefreshStrategyController = mMogoServiceApis.getRefreshStrategyControllerApi(); - mMogoEntranceButtonController = mMogoServiceApis.getEntranceButtonController(); - mMogoActionManager = mMogoServiceApis.getActionManagerApi(); - mMogoTopViewManager = mMogoServiceApis.getTopViewManager(); - mIMogoSearchManager = mMogoServiceApis.getSearchManagerApi(); - mIMogoMarkerService = mMogoServiceApis.getMarkerService(); - mIMogoShareManager = mMogoServiceApis.getShareManager(); - mIMogoTanluProvider = mMogoServiceApis.getTanluApi(); - mIMogoTrafficUploadProvider = mMogoServiceApis.getTrafficUploadApi(); - mMogoOnlineCarListPanelProvider = mMogoServiceApis.getOnlineCarPanelApi(); - //事件面板 - mIEventPanelProvider = mMogoServiceApis.getEventPanelManager(); - - mMarkerManager = mMapService.getMarkerManager(context); mNavi = mMapService.getNavi(context); - mMapUIController = mMapService.getMapUIController(); - mMogoLocationClient = mMapService.getSingletonLocationClient(context); - mMogoOverlayManager = mMapService.getOverlayManager(context); - mIMogoGeoSearch = mMapService.getGeoSearch(context); - - mMogoIntentManager = mMogoServiceApis.getIntentManagerApi(); } } @@ -111,103 +34,9 @@ public class ExtensionServiceManager { return mContext; } - public static IMogoTopViewManager getMogoTopViewManager() { - return mMogoTopViewManager; - } - - public static IMogoEntranceButtonController getMogoEntranceButtonController() { - return mMogoEntranceButtonController; - } - - public static IMogoMapService getMapService() { - return mMapService; - } - - public static IMogoOverlayManager getMogoOverlayManager() { - return mMogoOverlayManager; - } - - public static IMogoRegisterCenter getMogoRegisterCenter() { - return mMogoRegisterCenter; - } - - public static IMogoMarkerManager getMarkerManager() { - return mMarkerManager; - } - public static IMogoNavi getNavi() { return mNavi; } - public static IMogoMapUIController getMapUIController() { - return mMapUIController; - } - public static IMogoLocationClient getMogoLocationClient() { - return mMogoLocationClient; - } - - public static IMogoImageloader getImageLoader() { - return mImageLoader; - } - - public static IMogoSocketManager getMoGoSocketManager() { - return mMogoSocketManager; - } - - public static IMogoStatusManager getMoGoStatusManager() { - return mMogoStatusManager; - } - - public static IMogoWindowManager getIMogoWindowManager() { - return mIMogoWindowManager; - } - - public static IMogoIntentManager getMogoIntentManager() { - return mMogoIntentManager; - } - - public static IMogoActionManager getMogoActionManager() { - return mMogoActionManager; - } - - public static IMogoGeoSearch getMogoGeoSearch() { - return mIMogoGeoSearch; - } - - public static IMogoSearchManager getSearchManager() { - return mIMogoSearchManager; - } - - public static IMogoRefreshStrategyController getIMogoRefreshStrategyController() { - return mIMogoRefreshStrategyController; - } - - public static IMogoAnalytics getMogoAnalytics() { - return mMogoAnalytics; - } - - public static IMogoMarkerService getIMogoMarkerService() { - return mIMogoMarkerService; - } - - public static IMogoShareManager getMogoShareManager() { - return mIMogoShareManager; - } - - public static IMogoTanluProvider getTanluManager() { - return mIMogoTanluProvider; - } - - public static IMogoTrafficUploadProvider getIMogoTrafficUploadProvider() { - return mIMogoTrafficUploadProvider; - } - - public static IMogoOnlineCarListPanelProvider getMogoOnlineCarListPanelProvider() { - return mMogoOnlineCarListPanelProvider; - } - - public static IEventPanelProvider getEventPanelProvider() { - return mIEventPanelProvider; - } }