From 73ce6b667c79721f04aed3e0c275bf913b3e6f44 Mon Sep 17 00:00:00 2001 From: lixiaopeng Date: Mon, 30 Jan 2023 14:20:28 +0800 Subject: [PATCH 01/18] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=9E=9A=E4=B8=BE?= =?UTF-8?q?=E7=B1=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../eagle/core/data/enums/EventTypeEnumNew.kt | 97 ++++++++++++++----- 1 file changed, 74 insertions(+), 23 deletions(-) diff --git a/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/enums/EventTypeEnumNew.kt b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/enums/EventTypeEnumNew.kt index 6de86e6a02..977ff69174 100644 --- a/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/enums/EventTypeEnumNew.kt +++ b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/enums/EventTypeEnumNew.kt @@ -106,6 +106,12 @@ enum class EventTypeEnumNew( GHOST_PROBE("10024", "前方盲区行人预警", "前方盲区行人预警", R.drawable.icon_warning_v2x_pedestrian_crossing, "前方盲区行人通行,请注意", "前方盲区即将有行人通过,请减速慢行"), + //接管 + TAKE_OVER_EVENT( + "20000", "注意周围、立即接管", "注意周围、立即接管", R.drawable.icon_warning_take_over, + "注意周围、立即接管", "自动驾驶退出请立即接管" + ), + // 前方静止or慢速车辆报警 ALERT_FRONT_CAR("99999"), @@ -494,8 +500,9 @@ enum class EventTypeEnumNew( tts = "" ), - TYPE_VIP_IDENTIFICATION("10022", "", "", R.drawable.icon_warning_v2x_vip_turn_light, "VIP车辆优先通行", "已为您变灯,请优先通行"), - + TYPE_VIP_IDENTIFICATION_PASS("20022", "", "", R.drawable.icon_warning_v2x_vip_turn_light, "VIP车辆优先通行,已为您变为绿灯", "VIP车辆优先通行,已为您变为绿灯"), + TYPE_VIP_IDENTIFICATION_EXTEND("20023", "", "", R.drawable.icon_warning_v2x_vip_turn_light, "VIP车辆优先通行,已为您延长绿灯", "VIP车辆优先通行,已为您延长绿灯"), + TYPE_VIP_ERROR_IDENTIFICATION("20024", "", "", R.drawable.icon_warning_v2x_vip_turn_light, "请求失败,", "请求失败,稍后重试"), TYPE_OPTIMAL_ROUTE_RECOMMEND("2000", "", "", R.drawable.icon_warning_v2x_optimal_route, "为您推荐最优路线", "已为您选择最优路线"); @@ -669,7 +676,7 @@ enum class EventTypeEnumNew( fun getMarker3DRes(poiType: String?): Int { return when (poiType) { FOURS_BLOCK_UP.poiType -> R.raw.v2x_yongdu - FOURS_ACCIDENT.poiType -> R.raw.v2x_shigu + FOURS_ACCIDENT.poiType,FOURS_ACCIDENT_04.poiType -> R.raw.v2x_shigu FOURS_LIVING.poiType -> R.raw.v2x_shishilukuang FOURS_FOG.poiType -> R.raw.v2x_nongwu TRAFFIC_CHECK.poiType -> R.raw.v2x_jiaotongjiancha @@ -690,15 +697,15 @@ enum class EventTypeEnumNew( return when (poiType) { //交通检查 TRAFFIC_CHECK.poiType -> { - R.drawable.v_to_x_marker_2 + R.drawable.v2x_icon_jiaotongjiancha_vr } //封路 ROAD_CLOSED.poiType -> { - R.drawable.v_to_x_marker_16 + R.drawable.v2x_icon_fenglu_vr } //施工 FOURS_ROAD_WORK.poiType -> { - R.drawable.v_to_x_marker_11 + R.drawable.icon_warning_v2x_road_construction } //AI施工 TYPE_SOCKET_ROAD_SHIGONG.poiType -> R.drawable.icon_warning_v2x_road_construction @@ -707,23 +714,43 @@ enum class EventTypeEnumNew( TYPE_SOCKET_ROAD_CONGESTION.poiType -> R.drawable.v2x_icon_yongdu_vr //拥堵 FOURS_BLOCK_UP.poiType -> { - R.drawable.v_to_x_marker_5 + R.drawable.icon_warning_v2x_congestion } //积水 FOURS_PONDING.poiType -> { - R.drawable.v_to_x_marker_6 + R.drawable.v2x_icon_jishui_vr } //浓雾 FOURS_FOG.poiType -> { - R.drawable.v_to_x_marker_9 + R.drawable.v2x_icon_nongwu_vr } //结冰 FOURS_ICE.poiType -> { - R.drawable.v_to_x_marker_8 + R.drawable.v2x_icon_jiebing_vr } //事故 FOURS_ACCIDENT.poiType -> { - R.drawable.v_to_x_marker_7 + R.drawable.v2x_icon_jiaotongshigu_vr + } + //重大事故 + FOURS_ACCIDENT_01.poiType -> { + R.drawable.v2x_icon_jiaotongshigu_vr + } + //特大事故 + FOURS_ACCIDENT_02.poiType -> { + R.drawable.v2x_icon_jiaotongshigu_vr + } + //较大事故 + FOURS_ACCIDENT_03.poiType -> { + R.drawable.v2x_icon_jiaotongshigu_vr + } + //一般事故 + FOURS_ACCIDENT_04.poiType -> { + R.drawable.v2x_icon_jiaotongshigu_vr + } + //轻微事故 + FOURS_ACCIDENT_05.poiType -> { + R.drawable.v2x_icon_jiaotongshigu_vr } //事故 FOURS_LIVING.poiType -> { @@ -745,16 +772,38 @@ enum class EventTypeEnumNew( ALERT_CAR_TROUBLE_WARNING.poiType -> { R.drawable.icon_car_red } - - //闯红灯预警 - TYPE_USECASE_ID_IVP_RED.poiType -> { - R.drawable.icon_warning_v2x_traffic_lights_red + //VIP车辆优先通行,已为您变为绿灯 + TYPE_VIP_IDENTIFICATION_PASS.poiType -> { + R.drawable.icon_warning_v2x_vip_turn_light + } + //VIP车辆优先通行,已为您延长绿灯 + TYPE_VIP_IDENTIFICATION_EXTEND.poiType -> { + R.drawable.icon_warning_v2x_vip_turn_light + } + //VIP变灯请求失败 + TYPE_VIP_ERROR_IDENTIFICATION.poiType -> { + R.drawable.icon_warning_v2x_vip_turn_light + } + //最优路线 + TYPE_OPTIMAL_ROUTE_RECOMMEND.poiType -> { + R.drawable.icon_warning_v2x_optimal_route } //绿波通行 TYPE_USECASE_ID_IVP_GREEN.poiType -> { R.drawable.icon_warning_v2x_traffic_lights_green } - + //闯红灯预警 + TYPE_USECASE_ID_IVP_RED.poiType -> { + R.drawable.icon_warning_v2x_traffic_lights_red + } + //鬼探头类型 + GHOST_PROBE.poiType -> { + R.drawable.icon_warning_v2x_pedestrian_crossing + } + //接管 + TAKE_OVER_EVENT.poiType -> { + R.drawable.icon_warning_take_over + } //机动车 TYPE_USECASE_ID_VRUCW_MOTOR_VEHICLES.poiType -> { R.drawable.icon_warning_v2x_motorcycle_collision @@ -812,7 +861,7 @@ enum class EventTypeEnumNew( return when (poiType) { TYPE_USECASE_ID_EBW.poiType -> TYPE_USECASE_ID_EBW.poiTypeSrcVr TYPE_USECASE_ID_FCW.poiType -> TYPE_USECASE_ID_FCW.poiTypeSrcVr -// TYPE_USECASE_ID_ICW.poiType -> TYPE_USECASE_ID_ICW.poiTypeSrcVr + TYPE_USECASE_ID_ICW.poiType -> TYPE_USECASE_ID_ICW.poiTypeSrcVr TYPE_USECASE_ID_CLW.poiType -> TYPE_USECASE_ID_CLW.poiTypeSrcVr TYPE_USECASE_ID_DNPW.poiType -> TYPE_USECASE_ID_DNPW.poiTypeSrcVr TYPE_USECASE_ID_AVW.poiType -> TYPE_USECASE_ID_AVW.poiTypeSrcVr @@ -820,7 +869,8 @@ enum class EventTypeEnumNew( TYPE_USECASE_ID_LCW.poiType -> TYPE_USECASE_ID_LCW.poiTypeSrcVr TYPE_USECASE_ID_EVW.poiType -> TYPE_USECASE_ID_EVW.poiTypeSrcVr TYPE_USECASE_ID_LTA.poiType -> TYPE_USECASE_ID_LTA.poiTypeSrcVr - TYPE_VIP_IDENTIFICATION.poiType -> TYPE_VIP_IDENTIFICATION.poiTypeSrcVr + TYPE_VIP_IDENTIFICATION_PASS.poiType -> TYPE_VIP_IDENTIFICATION_PASS.poiTypeSrcVr + TYPE_VIP_IDENTIFICATION_EXTEND.poiType -> TYPE_VIP_IDENTIFICATION_EXTEND.poiTypeSrcVr TYPE_ERROR.poiType -> TYPE_ERROR.poiTypeSrcVr TYPE_OPTIMAL_ROUTE_RECOMMEND.poiType -> TYPE_OPTIMAL_ROUTE_RECOMMEND.poiTypeSrcVr GHOST_PROBE.poiType -> GHOST_PROBE.poiTypeSrcVr @@ -876,7 +926,7 @@ enum class EventTypeEnumNew( return when (poiType) { TYPE_USECASE_ID_EBW.poiType -> TYPE_USECASE_ID_EBW.content TYPE_USECASE_ID_FCW.poiType -> TYPE_USECASE_ID_FCW.content -// TYPE_USECASE_ID_ICW.poiType -> TYPE_USECASE_ID_ICW.content + TYPE_USECASE_ID_ICW.poiType -> TYPE_USECASE_ID_ICW.content TYPE_USECASE_ID_CLW.poiType -> TYPE_USECASE_ID_CLW.content TYPE_USECASE_ID_DNPW.poiType -> TYPE_USECASE_ID_DNPW.content TYPE_USECASE_ID_AVW.poiType -> TYPE_USECASE_ID_AVW.content @@ -884,7 +934,8 @@ enum class EventTypeEnumNew( TYPE_USECASE_ID_LCW.poiType -> TYPE_USECASE_ID_LCW.content TYPE_USECASE_ID_EVW.poiType -> TYPE_USECASE_ID_EVW.content TYPE_USECASE_ID_LTA.poiType -> TYPE_USECASE_ID_LTA.content - TYPE_VIP_IDENTIFICATION.poiType -> TYPE_VIP_IDENTIFICATION.content + TYPE_VIP_IDENTIFICATION_PASS.poiType -> TYPE_VIP_IDENTIFICATION_PASS.content + TYPE_VIP_IDENTIFICATION_EXTEND.poiType -> TYPE_VIP_IDENTIFICATION_EXTEND.content FOURS_ROAD_WORK.poiType -> FOURS_ROAD_WORK.content TYPE_SOCKET_ROAD_SHIGONG.poiType -> TYPE_SOCKET_ROAD_SHIGONG.content TYPE_SOCKET_ROAD_JINGZHI.poiType -> TYPE_SOCKET_ROAD_JINGZHI.content @@ -942,7 +993,7 @@ enum class EventTypeEnumNew( return when (poiType) { TYPE_USECASE_ID_EBW.poiType -> TYPE_USECASE_ID_EBW.tts TYPE_USECASE_ID_FCW.poiType -> TYPE_USECASE_ID_FCW.tts -// TYPE_USECASE_ID_ICW.poiType -> TYPE_USECASE_ID_ICW.tts + TYPE_USECASE_ID_ICW.poiType -> TYPE_USECASE_ID_ICW.tts TYPE_USECASE_ID_CLW.poiType -> TYPE_USECASE_ID_CLW.tts TYPE_USECASE_ID_DNPW.poiType -> TYPE_USECASE_ID_DNPW.tts TYPE_USECASE_ID_AVW.poiType -> TYPE_USECASE_ID_AVW.tts @@ -950,7 +1001,8 @@ enum class EventTypeEnumNew( TYPE_USECASE_ID_LCW.poiType -> TYPE_USECASE_ID_LCW.tts TYPE_USECASE_ID_EVW.poiType -> TYPE_USECASE_ID_EVW.tts TYPE_USECASE_ID_LTA.poiType -> TYPE_USECASE_ID_LTA.tts - TYPE_VIP_IDENTIFICATION.poiType -> TYPE_VIP_IDENTIFICATION.tts + TYPE_VIP_IDENTIFICATION_PASS.poiType -> TYPE_VIP_IDENTIFICATION_PASS.tts + TYPE_VIP_IDENTIFICATION_EXTEND.poiType -> TYPE_VIP_IDENTIFICATION_EXTEND.tts FOURS_ROAD_WORK.poiType -> FOURS_ROAD_WORK.tts TYPE_SOCKET_ROAD_SHIGONG.poiType -> TYPE_SOCKET_ROAD_SHIGONG.tts TYPE_SOCKET_ROAD_JINGZHI.poiType -> TYPE_SOCKET_ROAD_JINGZHI.tts @@ -1014,5 +1066,4 @@ enum class EventTypeEnumNew( } } } - } \ No newline at end of file From 995189fcecab006da1570b1930c6accebb21963f Mon Sep 17 00:00:00 2001 From: yangyakun Date: Mon, 30 Jan 2023 15:10:53 +0800 Subject: [PATCH 02/18] =?UTF-8?q?[dev=5Farch=5Fopt=5F3.0]=20[=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0noop=E7=BB=B4=E5=BA=A6=E5=8F=8A=E8=BF=87=E6=BB=A4]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/build.gradle | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/app/build.gradle b/app/build.gradle index 734265a7d3..b1a2ae93b4 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -210,6 +210,9 @@ android { buildConfigField 'String', 'MAP_SDK_VERSION', "\"${MAP_SDK_VERSION}\"" buildConfigField 'String', 'MAP_SDK_OPT_VERSION', "\"${MAP_SDK_OPERATION_VERSION}\"" } + noop { + dimension "business" + } busbase { dimension "business" } @@ -253,6 +256,12 @@ android { variantFilter { variant -> def names = variant.flavors*.name //要检查特定的构建类型,请使用variant.buildType.name ==“ ” + // region 过滤noop 的flavors 不带och业务的 + if (names.contains("noop")&&!names.contains("fPadLenovo")) { + //Gradle会忽略满足上述条件的所有变体 + setIgnore(true) + } + // endregion // region 过滤sweper 的flavors if (names.contains("sweeper")&&!names.contains("fPadLenovoOchSweeper")) { //Gradle会忽略满足上述条件的所有变体 From f0a02e4d01252143e9be042586b6dc1fa5881cbf Mon Sep 17 00:00:00 2001 From: wangmingjun Date: Mon, 30 Jan 2023 15:40:23 +0800 Subject: [PATCH 03/18] =?UTF-8?q?[opt]=20OCH=E6=A8=A1=E5=9D=97=E5=8E=BB?= =?UTF-8?q?=E9=99=A4=E5=BC=95=E7=94=A8v2x?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- OCH/mogo-och-bus-passenger/build.gradle | 2 - OCH/mogo-och-common-module/build.gradle | 2 - OCH/mogo-och-taxi-passenger/build.gradle | 2 - OCH/mogo-och-taxi/build.gradle | 2 - .../com/mogo/och/taxi/TaxiOverlayManager.java | 71 ------------------- 5 files changed, 79 deletions(-) delete mode 100644 OCH/mogo-och-taxi/src/main/java/com/mogo/och/taxi/TaxiOverlayManager.java diff --git a/OCH/mogo-och-bus-passenger/build.gradle b/OCH/mogo-och-bus-passenger/build.gradle index af805de9a1..0677d0aacd 100644 --- a/OCH/mogo-och-bus-passenger/build.gradle +++ b/OCH/mogo-och-bus-passenger/build.gradle @@ -57,7 +57,6 @@ dependencies { implementation rootProject.ext.dependencies.mogocommons implementation rootProject.ext.dependencies.mogo_core_data implementation rootProject.ext.dependencies.mogo_core_function_call - implementation rootProject.ext.dependencies.mogo_core_function_v2x implementation rootProject.ext.dependencies.mogo_core_function_hmi }else { implementation project(':foudations:mogo-aicloud-services-sdk') @@ -65,7 +64,6 @@ dependencies { implementation project(':core:mogo-core-data') implementation project(":core:mogo-core-utils") implementation project(':core:mogo-core-function-call') - implementation project(':core:function-impl:mogo-core-function-v2x') implementation project(':core:function-impl:mogo-core-function-hmi') } } diff --git a/OCH/mogo-och-common-module/build.gradle b/OCH/mogo-och-common-module/build.gradle index 6bcce00b7e..4045e3d793 100644 --- a/OCH/mogo-och-common-module/build.gradle +++ b/OCH/mogo-och-common-module/build.gradle @@ -62,14 +62,12 @@ dependencies { implementation rootProject.ext.dependencies.mogocommons implementation rootProject.ext.dependencies.mogo_core_data implementation rootProject.ext.dependencies.mogo_core_function_call - implementation rootProject.ext.dependencies.mogo_core_function_v2x implementation rootProject.ext.dependencies.mogo_core_function_hmi }else { implementation project(":core:mogo-core-utils") implementation project(":foudations:mogo-commons") implementation project(':core:mogo-core-data') implementation project(':core:mogo-core-function-call') - implementation project(':core:function-impl:mogo-core-function-v2x') implementation project(':core:function-impl:mogo-core-function-hmi') } diff --git a/OCH/mogo-och-taxi-passenger/build.gradle b/OCH/mogo-och-taxi-passenger/build.gradle index a682c2e839..03c8289c7f 100644 --- a/OCH/mogo-och-taxi-passenger/build.gradle +++ b/OCH/mogo-och-taxi-passenger/build.gradle @@ -60,14 +60,12 @@ dependencies { implementation rootProject.ext.dependencies.mogocommons implementation rootProject.ext.dependencies.mogo_core_data implementation rootProject.ext.dependencies.mogo_core_function_call - implementation rootProject.ext.dependencies.mogo_core_function_v2x implementation rootProject.ext.dependencies.mogo_core_res }else { implementation project(":core:mogo-core-utils") implementation project(":foudations:mogo-commons") implementation project(':core:mogo-core-data') implementation project(':core:mogo-core-function-call') - implementation project(':core:function-impl:mogo-core-function-v2x') implementation project(':core:mogo-core-res') } } diff --git a/OCH/mogo-och-taxi/build.gradle b/OCH/mogo-och-taxi/build.gradle index f802637796..8ca98d2c2c 100644 --- a/OCH/mogo-och-taxi/build.gradle +++ b/OCH/mogo-och-taxi/build.gradle @@ -59,14 +59,12 @@ dependencies { implementation rootProject.ext.dependencies.mogocommons implementation rootProject.ext.dependencies.mogo_core_data implementation rootProject.ext.dependencies.mogo_core_function_call - implementation rootProject.ext.dependencies.mogo_core_function_v2x implementation rootProject.ext.dependencies.mogo_core_function_hmi }else { implementation project(":core:mogo-core-utils") implementation project(":foudations:mogo-commons") implementation project(':core:mogo-core-data') implementation project(':core:mogo-core-function-call') - implementation project(':core:function-impl:mogo-core-function-v2x') implementation project(':core:function-impl:mogo-core-function-hmi') } } diff --git a/OCH/mogo-och-taxi/src/main/java/com/mogo/och/taxi/TaxiOverlayManager.java b/OCH/mogo-och-taxi/src/main/java/com/mogo/och/taxi/TaxiOverlayManager.java deleted file mode 100644 index d525f97b1b..0000000000 --- a/OCH/mogo-och-taxi/src/main/java/com/mogo/och/taxi/TaxiOverlayManager.java +++ /dev/null @@ -1,71 +0,0 @@ -package com.mogo.och.taxi; - -import android.content.Context; - -import com.mogo.eagle.core.data.map.MogoLatLng; -import com.mogo.eagle.core.data.map.MogoLocation; -import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager; -import com.mogo.commons.utils.LocationUtils; -import com.mogo.eagle.core.utilcode.util.ColorUtils; -import com.mogo.map.overlay.IMogoOverlayManager; -import com.mogo.map.overlay.IMogoPolyline; -import com.mogo.map.overlay.MogoPolylineOptions; -import java.util.ArrayList; -import java.util.List; - -public class TaxiOverlayManager { - - - private IMogoPolyline mMoGoPolyline; - // 连接线参数 - private MogoPolylineOptions mPolylineOptions; - // 线路径集合 - private List mPolylinePointList; - // 渐变色 - private List mPolylineColors; - private Context mContext; - IMogoOverlayManager mogoOverlayManager; - public TaxiOverlayManager(Context context) { - mPolylineOptions = new MogoPolylineOptions(); - // 绘制路径集合 - mPolylinePointList = new ArrayList<>(); - // 引导线颜色 - mPolylineColors = new ArrayList<>(); - mContext = context; - mogoOverlayManager = CallerMapUIServiceManager.INSTANCE.getOverlayManager(context); - } - - /** - * 绘制最优路线 - * - * @param polylinePoint 要绘制的经纬度度集合 - */ - public IMogoPolyline draw(MogoLocation carLocal, List polylinePoint) { - if (mMoGoPolyline != null) { - mMoGoPolyline.remove(); - mPolylinePointList.clear(); - mPolylineColors.clear(); - } - if (polylinePoint != null) { - - // 将当前车辆位置放进去 - mPolylinePointList.add(new MogoLatLng(carLocal.getLatitude(), carLocal.getLongitude())); - // 过滤后台推送的推荐路线集合 - for (MogoLatLng polyline : polylinePoint) { - //需要剔除已经行驶过的经纬度,这里需要比对推荐路线集合中的点是否在当前车辆行驶方向前面如果不在则抛弃 - if (LocationUtils.isPointOnCarFront(carLocal, polyline)) { - mPolylinePointList.add(polyline); - } - } - mPolylineColors.addAll(ColorUtils.getGradientAlpha("#002965ED", "#FF2965ED", "#002965ED", mPolylinePointList.size())); - // 替换路径集合 - mPolylineOptions.points(mPolylinePointList); - // 线条粗细,渐变,渐变色值 - mPolylineOptions.width(25).useGradient(true).colorValues(mPolylineColors); - // 绘制线 - mMoGoPolyline = mogoOverlayManager.addPolyline(mPolylineOptions); - } - return mMoGoPolyline; - } - -} From dac67410552e2cef52e0817f1c344dc512ae0faa Mon Sep 17 00:00:00 2001 From: donghongyu Date: Mon, 30 Jan 2023 16:52:39 +0800 Subject: [PATCH 04/18] =?UTF-8?q?[dev=5Farch=5Fopt=5F3.0]=20[Change]=20[?= =?UTF-8?q?=201=E3=80=81=E8=BF=81=E7=A7=BBmogo-core-function-obu-mogo?= =?UTF-8?q?=E5=B7=A5=E7=A8=8B=E5=88=B0MoGoEagleEye.core.function-impl.mogo?= =?UTF-8?q?-core-function-datacenter=EF=BC=8C=E5=90=8E=E7=BB=AD=E8=BF=9B?= =?UTF-8?q?=E8=A1=8C=E6=95=B0=E6=8D=AE=E5=8F=8A=E8=A7=86=E5=9B=BE=E6=8B=86?= =?UTF-8?q?=E7=A6=BB=20]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: donghongyu --- .../README.md | 0 .../build.gradle | 7 +- ...PSALPINE CV2X AMI Specification v1.0.7.pdf | Bin .../doc/AMI通讯协议.docx | Bin .../doc/CV2X_HLI_v1.0.1.pdf | Bin .../doc/HLI通讯协议.docx | Bin .../src/main/AndroidManifest.xml | 37 ++++++++++ .../autopilot/MoGoAutopilotProvider.kt | 2 +- .../datacenter/obu}/MoGoObuProvider.kt | 2 +- .../datacenter/obu}/MogoObuConst.java | 2 +- .../obu}/MogoObuDcCombineManager.kt | 2 +- .../datacenter/obu}/MogoPrivateObuManager.kt | 4 +- .../obu}/MogoPrivateObuNewManager.kt | 4 +- .../receiver/ObuRsuTestTriggerReceiver.kt | 4 +- .../obu}/receiver/ObuTestNewObuReceiver.kt | 5 +- .../obu}/receiver/ObuTestNewObuRsiReceiver.kt | 9 +-- .../obu}/receiver/ObuTestTriggerReceiver.kt | 4 +- .../ObuTestTriggerRecognizedReceiver.kt | 4 +- .../obu}/utils/TrafficDataConvertUtils.kt | 2 +- .../obu}/utils/TrafficDataConvertUtilsNew.kt | 3 +- .../mogo-core-function-hmi/build.gradle | 2 - .../mogo-core-function-obu-mogo/.gitignore | 1 - .../mogo-core-function-obu-mogo/build.gradle | 67 ------------------ .../consumer-rules.pro | 0 .../gradle.properties | 3 - .../proguard-rules.pro | 21 ------ .../src/main/AndroidManifest.xml | 45 ------------ .../IMoGoRoboBusJinlvM1StatesListener.kt | 1 - .../CallerAutoPilotStatusListenerManager.kt | 4 +- .../core/function/call/autopilot/REEADME.md | 62 ++++++++++++++-- modules.txt | 2 +- settings.gradle | 4 +- 32 files changed, 122 insertions(+), 181 deletions(-) rename core/function-impl/{mogo-core-function-obu-mogo => mogo-core-function-datacenter}/README.md (100%) rename core/function-impl/{mogo-core-function-obu-mogo => mogo-core-function-datacenter}/doc/ALPSALPINE CV2X AMI Specification v1.0.7.pdf (100%) rename core/function-impl/{mogo-core-function-obu-mogo => mogo-core-function-datacenter}/doc/AMI通讯协议.docx (100%) rename core/function-impl/{mogo-core-function-obu-mogo => mogo-core-function-datacenter}/doc/CV2X_HLI_v1.0.1.pdf (100%) rename core/function-impl/{mogo-core-function-obu-mogo => mogo-core-function-datacenter}/doc/HLI通讯协议.docx (100%) rename core/function-impl/{mogo-core-function-obu-mogo/src/main/java/com/mogo/eagle/core/function/obu/mogo => mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/obu}/MoGoObuProvider.kt (98%) rename core/function-impl/{mogo-core-function-obu-mogo/src/main/java/com/mogo/eagle/core/function/obu/mogo => mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/obu}/MogoObuConst.java (95%) rename core/function-impl/{mogo-core-function-obu-mogo/src/main/java/com/mogo/eagle/core/function/obu/mogo => mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/obu}/MogoObuDcCombineManager.kt (99%) rename core/function-impl/{mogo-core-function-obu-mogo/src/main/java/com/mogo/eagle/core/function/obu/mogo => mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/obu}/MogoPrivateObuManager.kt (99%) rename core/function-impl/{mogo-core-function-obu-mogo/src/main/java/com/mogo/eagle/core/function/obu/mogo => mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/obu}/MogoPrivateObuNewManager.kt (99%) rename core/function-impl/{mogo-core-function-obu-mogo/src/main/java/com/mogo/eagle/core/function/obu/mogo => mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/obu}/receiver/ObuRsuTestTriggerReceiver.kt (97%) rename core/function-impl/{mogo-core-function-obu-mogo/src/main/java/com/mogo/eagle/core/function/obu/mogo => mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/obu}/receiver/ObuTestNewObuReceiver.kt (91%) rename core/function-impl/{mogo-core-function-obu-mogo/src/main/java/com/mogo/eagle/core/function/obu/mogo => mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/obu}/receiver/ObuTestNewObuRsiReceiver.kt (82%) rename core/function-impl/{mogo-core-function-obu-mogo/src/main/java/com/mogo/eagle/core/function/obu/mogo => mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/obu}/receiver/ObuTestTriggerReceiver.kt (96%) rename core/function-impl/{mogo-core-function-obu-mogo/src/main/java/com/mogo/eagle/core/function/obu/mogo => mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/obu}/receiver/ObuTestTriggerRecognizedReceiver.kt (93%) rename core/function-impl/{mogo-core-function-obu-mogo/src/main/java/com/mogo/eagle/core/function/obu/mogo => mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/obu}/utils/TrafficDataConvertUtils.kt (98%) rename core/function-impl/{mogo-core-function-obu-mogo/src/main/java/com/mogo/eagle/core/function/obu/mogo => mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/obu}/utils/TrafficDataConvertUtilsNew.kt (98%) delete mode 100644 core/function-impl/mogo-core-function-obu-mogo/.gitignore delete mode 100644 core/function-impl/mogo-core-function-obu-mogo/build.gradle delete mode 100644 core/function-impl/mogo-core-function-obu-mogo/consumer-rules.pro delete mode 100644 core/function-impl/mogo-core-function-obu-mogo/gradle.properties delete mode 100644 core/function-impl/mogo-core-function-obu-mogo/proguard-rules.pro delete mode 100644 core/function-impl/mogo-core-function-obu-mogo/src/main/AndroidManifest.xml diff --git a/core/function-impl/mogo-core-function-obu-mogo/README.md b/core/function-impl/mogo-core-function-datacenter/README.md similarity index 100% rename from core/function-impl/mogo-core-function-obu-mogo/README.md rename to core/function-impl/mogo-core-function-datacenter/README.md diff --git a/core/function-impl/mogo-core-function-datacenter/build.gradle b/core/function-impl/mogo-core-function-datacenter/build.gradle index b6e5f51262..5b637a7ae6 100644 --- a/core/function-impl/mogo-core-function-datacenter/build.gradle +++ b/core/function-impl/mogo-core-function-datacenter/build.gradle @@ -57,13 +57,16 @@ dependencies { implementation rootProject.ext.dependencies.mogoami implementation rootProject.ext.dependencies.mogoaicloudtelematic + implementation rootProject.ext.dependencies.mogoobuold + implementation rootProject.ext.dependencies.mogoobu + if (Boolean.valueOf(USE_MAVEN_PACKAGE)) { implementation rootProject.ext.dependencies.mogo_core_data implementation rootProject.ext.dependencies.mogo_core_utils implementation rootProject.ext.dependencies.mogo_core_function_call implementation project(':libraries:mogo-adas') - + implementation rootProject.ext.dependencies.mogocommons } else { implementation project(':core:mogo-core-data') implementation project(':core:mogo-core-utils') @@ -71,8 +74,6 @@ dependencies { implementation project(':libraries:mogo-adas') implementation project(':foudations:mogo-commons') - - } } diff --git a/core/function-impl/mogo-core-function-obu-mogo/doc/ALPSALPINE CV2X AMI Specification v1.0.7.pdf b/core/function-impl/mogo-core-function-datacenter/doc/ALPSALPINE CV2X AMI Specification v1.0.7.pdf similarity index 100% rename from core/function-impl/mogo-core-function-obu-mogo/doc/ALPSALPINE CV2X AMI Specification v1.0.7.pdf rename to core/function-impl/mogo-core-function-datacenter/doc/ALPSALPINE CV2X AMI Specification v1.0.7.pdf diff --git a/core/function-impl/mogo-core-function-obu-mogo/doc/AMI通讯协议.docx b/core/function-impl/mogo-core-function-datacenter/doc/AMI通讯协议.docx similarity index 100% rename from core/function-impl/mogo-core-function-obu-mogo/doc/AMI通讯协议.docx rename to core/function-impl/mogo-core-function-datacenter/doc/AMI通讯协议.docx diff --git a/core/function-impl/mogo-core-function-obu-mogo/doc/CV2X_HLI_v1.0.1.pdf b/core/function-impl/mogo-core-function-datacenter/doc/CV2X_HLI_v1.0.1.pdf similarity index 100% rename from core/function-impl/mogo-core-function-obu-mogo/doc/CV2X_HLI_v1.0.1.pdf rename to core/function-impl/mogo-core-function-datacenter/doc/CV2X_HLI_v1.0.1.pdf diff --git a/core/function-impl/mogo-core-function-obu-mogo/doc/HLI通讯协议.docx b/core/function-impl/mogo-core-function-datacenter/doc/HLI通讯协议.docx similarity index 100% rename from core/function-impl/mogo-core-function-obu-mogo/doc/HLI通讯协议.docx rename to core/function-impl/mogo-core-function-datacenter/doc/HLI通讯协议.docx diff --git a/core/function-impl/mogo-core-function-datacenter/src/main/AndroidManifest.xml b/core/function-impl/mogo-core-function-datacenter/src/main/AndroidManifest.xml index ee1c554d89..e641d09ce5 100644 --- a/core/function-impl/mogo-core-function-datacenter/src/main/AndroidManifest.xml +++ b/core/function-impl/mogo-core-function-datacenter/src/main/AndroidManifest.xml @@ -1,6 +1,43 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/autopilot/MoGoAutopilotProvider.kt b/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/autopilot/MoGoAutopilotProvider.kt index 7cf7e5da02..cc50534c63 100644 --- a/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/autopilot/MoGoAutopilotProvider.kt +++ b/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/autopilot/MoGoAutopilotProvider.kt @@ -62,9 +62,9 @@ import java.util.concurrent.TimeUnit /** + * 域控制器 * @author xiaoyuzhou * @date 2021/9/22 8:43 下午 - * 域控制器 */ @Route(path = MogoServicePaths.PATH_AUTO_PILOT) class MoGoAutopilotProvider : diff --git a/core/function-impl/mogo-core-function-obu-mogo/src/main/java/com/mogo/eagle/core/function/obu/mogo/MoGoObuProvider.kt b/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/obu/MoGoObuProvider.kt similarity index 98% rename from core/function-impl/mogo-core-function-obu-mogo/src/main/java/com/mogo/eagle/core/function/obu/mogo/MoGoObuProvider.kt rename to core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/obu/MoGoObuProvider.kt index f9c946d9f7..dc2f967b43 100644 --- a/core/function-impl/mogo-core-function-obu-mogo/src/main/java/com/mogo/eagle/core/function/obu/mogo/MoGoObuProvider.kt +++ b/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/obu/MoGoObuProvider.kt @@ -1,4 +1,4 @@ -package com.mogo.eagle.core.function.obu.mogo +package com.mogo.eagle.core.function.datacenter.obu import android.content.Context import com.alibaba.android.arouter.facade.annotation.Route diff --git a/core/function-impl/mogo-core-function-obu-mogo/src/main/java/com/mogo/eagle/core/function/obu/mogo/MogoObuConst.java b/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/obu/MogoObuConst.java similarity index 95% rename from core/function-impl/mogo-core-function-obu-mogo/src/main/java/com/mogo/eagle/core/function/obu/mogo/MogoObuConst.java rename to core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/obu/MogoObuConst.java index c4aa8f0906..8134f27b41 100644 --- a/core/function-impl/mogo-core-function-obu-mogo/src/main/java/com/mogo/eagle/core/function/obu/mogo/MogoObuConst.java +++ b/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/obu/MogoObuConst.java @@ -1,4 +1,4 @@ -package com.mogo.eagle.core.function.obu.mogo; +package com.mogo.eagle.core.function.datacenter.obu; /** * author : lxiiaopeng diff --git a/core/function-impl/mogo-core-function-obu-mogo/src/main/java/com/mogo/eagle/core/function/obu/mogo/MogoObuDcCombineManager.kt b/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/obu/MogoObuDcCombineManager.kt similarity index 99% rename from core/function-impl/mogo-core-function-obu-mogo/src/main/java/com/mogo/eagle/core/function/obu/mogo/MogoObuDcCombineManager.kt rename to core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/obu/MogoObuDcCombineManager.kt index f95f73480d..8950dd989b 100644 --- a/core/function-impl/mogo-core-function-obu-mogo/src/main/java/com/mogo/eagle/core/function/obu/mogo/MogoObuDcCombineManager.kt +++ b/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/obu/MogoObuDcCombineManager.kt @@ -1,4 +1,4 @@ -package com.mogo.eagle.core.function.obu.mogo +package com.mogo.eagle.core.function.datacenter.obu import android.content.Context import com.mogo.eagle.core.data.config.HmiBuildConfig diff --git a/core/function-impl/mogo-core-function-obu-mogo/src/main/java/com/mogo/eagle/core/function/obu/mogo/MogoPrivateObuManager.kt b/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/obu/MogoPrivateObuManager.kt similarity index 99% rename from core/function-impl/mogo-core-function-obu-mogo/src/main/java/com/mogo/eagle/core/function/obu/mogo/MogoPrivateObuManager.kt rename to core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/obu/MogoPrivateObuManager.kt index a942a7556e..091de99b08 100644 --- a/core/function-impl/mogo-core-function-obu-mogo/src/main/java/com/mogo/eagle/core/function/obu/mogo/MogoPrivateObuManager.kt +++ b/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/obu/MogoPrivateObuManager.kt @@ -1,4 +1,4 @@ -package com.mogo.eagle.core.function.obu.mogo +package com.mogo.eagle.core.function.datacenter.obu import android.content.Context import android.util.Log @@ -20,7 +20,7 @@ import com.mogo.eagle.core.function.call.map.CallerVisualAngleManager.Scene.Defa import com.mogo.eagle.core.function.call.map.CallerVisualAngleManager.Scene.TooClose import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxManager import com.mogo.eagle.core.function.call.obu.CallerObuListenerManager -import com.mogo.eagle.core.function.obu.mogo.utils.TrafficDataConvertUtils +import com.mogo.eagle.core.function.datacenter.obu.utils.TrafficDataConvertUtils import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_OBU import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr diff --git a/core/function-impl/mogo-core-function-obu-mogo/src/main/java/com/mogo/eagle/core/function/obu/mogo/MogoPrivateObuNewManager.kt b/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/obu/MogoPrivateObuNewManager.kt similarity index 99% rename from core/function-impl/mogo-core-function-obu-mogo/src/main/java/com/mogo/eagle/core/function/obu/mogo/MogoPrivateObuNewManager.kt rename to core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/obu/MogoPrivateObuNewManager.kt index 93706d2adc..da706a4900 100644 --- a/core/function-impl/mogo-core-function-obu-mogo/src/main/java/com/mogo/eagle/core/function/obu/mogo/MogoPrivateObuNewManager.kt +++ b/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/obu/MogoPrivateObuNewManager.kt @@ -1,4 +1,4 @@ -package com.mogo.eagle.core.function.obu.mogo +package com.mogo.eagle.core.function.datacenter.obu import android.content.Context import com.mogo.eagle.core.data.config.FunctionBuildConfig @@ -19,7 +19,7 @@ import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxManager import com.mogo.eagle.core.function.call.obu.CallerObuListenerManager import com.mogo.eagle.core.function.call.obu.CallerObuTrafficLightListenerManager import com.mogo.eagle.core.function.call.v2x.CallObuLimitingSpeedListenerManager -import com.mogo.eagle.core.function.obu.mogo.utils.TrafficDataConvertUtilsNew +import com.mogo.eagle.core.function.datacenter.obu.utils.TrafficDataConvertUtilsNew import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_OBU import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr diff --git a/core/function-impl/mogo-core-function-obu-mogo/src/main/java/com/mogo/eagle/core/function/obu/mogo/receiver/ObuRsuTestTriggerReceiver.kt b/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/obu/receiver/ObuRsuTestTriggerReceiver.kt similarity index 97% rename from core/function-impl/mogo-core-function-obu-mogo/src/main/java/com/mogo/eagle/core/function/obu/mogo/receiver/ObuRsuTestTriggerReceiver.kt rename to core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/obu/receiver/ObuRsuTestTriggerReceiver.kt index 644de55099..d79a247af1 100644 --- a/core/function-impl/mogo-core-function-obu-mogo/src/main/java/com/mogo/eagle/core/function/obu/mogo/receiver/ObuRsuTestTriggerReceiver.kt +++ b/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/obu/receiver/ObuRsuTestTriggerReceiver.kt @@ -1,10 +1,10 @@ -package com.mogo.eagle.core.function.obu.mogo.receiver +package com.mogo.eagle.core.function.datacenter.obu.receiver import android.content.BroadcastReceiver import android.content.Context import android.content.Intent //import com.mogo.eagle.core.function.obu.mogo.MogoObuConst -//import com.mogo.eagle.core.function.obu.mogo.MogoPrivateObuManager +//import com.mogo.eagle.core.function.datacenter.obu.MogoPrivateObuManager //import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger //import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_OBU //import com.zhidao.support.obu.constants.ObuConstants diff --git a/core/function-impl/mogo-core-function-obu-mogo/src/main/java/com/mogo/eagle/core/function/obu/mogo/receiver/ObuTestNewObuReceiver.kt b/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/obu/receiver/ObuTestNewObuReceiver.kt similarity index 91% rename from core/function-impl/mogo-core-function-obu-mogo/src/main/java/com/mogo/eagle/core/function/obu/mogo/receiver/ObuTestNewObuReceiver.kt rename to core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/obu/receiver/ObuTestNewObuReceiver.kt index 17f677cd98..ed1abd5575 100644 --- a/core/function-impl/mogo-core-function-obu-mogo/src/main/java/com/mogo/eagle/core/function/obu/mogo/receiver/ObuTestNewObuReceiver.kt +++ b/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/obu/receiver/ObuTestNewObuReceiver.kt @@ -1,10 +1,9 @@ -package com.mogo.eagle.core.function.obu.mogo.receiver +package com.mogo.eagle.core.function.datacenter.obu.receiver import android.content.BroadcastReceiver import android.content.Context import android.content.Intent -import android.util.Log -import com.mogo.eagle.core.function.obu.mogo.MogoPrivateObuNewManager +import com.mogo.eagle.core.function.datacenter.obu.MogoPrivateObuNewManager import com.mogo.support.obu.model.MogoObuRvWarningData import com.mogo.support.obu.model.advance.V2xWarning import com.mogo.support.obu.model.advance.VehBasics diff --git a/core/function-impl/mogo-core-function-obu-mogo/src/main/java/com/mogo/eagle/core/function/obu/mogo/receiver/ObuTestNewObuRsiReceiver.kt b/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/obu/receiver/ObuTestNewObuRsiReceiver.kt similarity index 82% rename from core/function-impl/mogo-core-function-obu-mogo/src/main/java/com/mogo/eagle/core/function/obu/mogo/receiver/ObuTestNewObuRsiReceiver.kt rename to core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/obu/receiver/ObuTestNewObuRsiReceiver.kt index c216a9e7be..f0b78a14f8 100644 --- a/core/function-impl/mogo-core-function-obu-mogo/src/main/java/com/mogo/eagle/core/function/obu/mogo/receiver/ObuTestNewObuRsiReceiver.kt +++ b/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/obu/receiver/ObuTestNewObuRsiReceiver.kt @@ -1,16 +1,11 @@ -package com.mogo.eagle.core.function.obu.mogo.receiver +package com.mogo.eagle.core.function.datacenter.obu.receiver import android.content.BroadcastReceiver import android.content.Context import android.content.Intent -import android.util.Log -import com.mogo.eagle.core.function.obu.mogo.MogoPrivateObuNewManager +import com.mogo.eagle.core.function.datacenter.obu.MogoPrivateObuNewManager import com.mogo.support.obu.model.MogoObuRsiWarningData -import com.mogo.support.obu.model.MogoObuRvWarningData import com.mogo.support.obu.model.advance.RsiWarning -import com.mogo.support.obu.model.advance.V2xWarning -import com.mogo.support.obu.model.advance.VehBasics -import com.mogo.support.obu.model.advance.WarningData /** * @author lixiaopeng diff --git a/core/function-impl/mogo-core-function-obu-mogo/src/main/java/com/mogo/eagle/core/function/obu/mogo/receiver/ObuTestTriggerReceiver.kt b/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/obu/receiver/ObuTestTriggerReceiver.kt similarity index 96% rename from core/function-impl/mogo-core-function-obu-mogo/src/main/java/com/mogo/eagle/core/function/obu/mogo/receiver/ObuTestTriggerReceiver.kt rename to core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/obu/receiver/ObuTestTriggerReceiver.kt index de530930bd..052107741e 100644 --- a/core/function-impl/mogo-core-function-obu-mogo/src/main/java/com/mogo/eagle/core/function/obu/mogo/receiver/ObuTestTriggerReceiver.kt +++ b/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/obu/receiver/ObuTestTriggerReceiver.kt @@ -1,10 +1,10 @@ -package com.mogo.eagle.core.function.obu.mogo.receiver +package com.mogo.eagle.core.function.datacenter.obu.receiver import android.content.BroadcastReceiver import android.content.Context import android.content.Intent //import com.mogo.eagle.core.function.obu.mogo.MogoObuConst -//import com.mogo.eagle.core.function.obu.mogo.MogoPrivateObuManager +//import com.mogo.eagle.core.function.datacenter.obu.MogoPrivateObuManager //import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger //import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_OBU //import com.zhidao.support.obu.constants.ObuConstants diff --git a/core/function-impl/mogo-core-function-obu-mogo/src/main/java/com/mogo/eagle/core/function/obu/mogo/receiver/ObuTestTriggerRecognizedReceiver.kt b/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/obu/receiver/ObuTestTriggerRecognizedReceiver.kt similarity index 93% rename from core/function-impl/mogo-core-function-obu-mogo/src/main/java/com/mogo/eagle/core/function/obu/mogo/receiver/ObuTestTriggerRecognizedReceiver.kt rename to core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/obu/receiver/ObuTestTriggerRecognizedReceiver.kt index fa51916e3b..cd7f5ce3df 100644 --- a/core/function-impl/mogo-core-function-obu-mogo/src/main/java/com/mogo/eagle/core/function/obu/mogo/receiver/ObuTestTriggerRecognizedReceiver.kt +++ b/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/obu/receiver/ObuTestTriggerRecognizedReceiver.kt @@ -1,10 +1,10 @@ -package com.mogo.eagle.core.function.obu.mogo.receiver +package com.mogo.eagle.core.function.datacenter.obu.receiver import android.content.BroadcastReceiver import android.content.Context import android.content.Intent //import com.mogo.eagle.core.function.obu.mogo.MogoObuConst -//import com.mogo.eagle.core.function.obu.mogo.MogoPrivateObuManager +//import com.mogo.eagle.core.function.datacenter.obu.MogoPrivateObuManager //import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger //import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_OBU //import com.zhidao.support.obu.model.CvxHvInfoIndInfo diff --git a/core/function-impl/mogo-core-function-obu-mogo/src/main/java/com/mogo/eagle/core/function/obu/mogo/utils/TrafficDataConvertUtils.kt b/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/obu/utils/TrafficDataConvertUtils.kt similarity index 98% rename from core/function-impl/mogo-core-function-obu-mogo/src/main/java/com/mogo/eagle/core/function/obu/mogo/utils/TrafficDataConvertUtils.kt rename to core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/obu/utils/TrafficDataConvertUtils.kt index 8e94bc8bc6..7dfc6f61ec 100644 --- a/core/function-impl/mogo-core-function-obu-mogo/src/main/java/com/mogo/eagle/core/function/obu/mogo/utils/TrafficDataConvertUtils.kt +++ b/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/obu/utils/TrafficDataConvertUtils.kt @@ -1,4 +1,4 @@ -package com.mogo.eagle.core.function.obu.mogo.utils +package com.mogo.eagle.core.function.datacenter.obu.utils import com.mogo.eagle.core.data.traffic.TrafficData import com.mogo.eagle.core.data.enums.TrafficTypeEnum diff --git a/core/function-impl/mogo-core-function-obu-mogo/src/main/java/com/mogo/eagle/core/function/obu/mogo/utils/TrafficDataConvertUtilsNew.kt b/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/obu/utils/TrafficDataConvertUtilsNew.kt similarity index 98% rename from core/function-impl/mogo-core-function-obu-mogo/src/main/java/com/mogo/eagle/core/function/obu/mogo/utils/TrafficDataConvertUtilsNew.kt rename to core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/obu/utils/TrafficDataConvertUtilsNew.kt index 7a253a920d..551c4d9c8b 100644 --- a/core/function-impl/mogo-core-function-obu-mogo/src/main/java/com/mogo/eagle/core/function/obu/mogo/utils/TrafficDataConvertUtilsNew.kt +++ b/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/obu/utils/TrafficDataConvertUtilsNew.kt @@ -1,6 +1,5 @@ -package com.mogo.eagle.core.function.obu.mogo.utils +package com.mogo.eagle.core.function.datacenter.obu.utils -import android.util.Log import com.mogo.eagle.core.data.enums.TrafficTypeEnum import com.mogo.eagle.core.data.traffic.TrafficData import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger diff --git a/core/function-impl/mogo-core-function-hmi/build.gradle b/core/function-impl/mogo-core-function-hmi/build.gradle index df17cbf358..73ff2911a2 100644 --- a/core/function-impl/mogo-core-function-hmi/build.gradle +++ b/core/function-impl/mogo-core-function-hmi/build.gradle @@ -88,7 +88,6 @@ dependencies { api rootProject.ext.dependencies.mogo_core_data api rootProject.ext.dependencies.mogo_core_utils api rootProject.ext.dependencies.mogo_core_network - api rootProject.ext.dependencies.mogo_core_function_obu_mogo api rootProject.ext.dependencies.mogo_core_function_map api rootProject.ext.dependencies.mogo_core_function_v2x api rootProject.ext.dependencies.mogo_core_function_devatools @@ -104,7 +103,6 @@ dependencies { api project(':core:mogo-core-res') api project(':core:mogo-core-data') api project(':core:mogo-core-utils') - api project(':core:function-impl:mogo-core-function-obu-mogo') api project(':core:function-impl:mogo-core-function-map') api project(':core:function-impl:mogo-core-function-v2x') api project(':core:function-impl:mogo-core-function-devatools') diff --git a/core/function-impl/mogo-core-function-obu-mogo/.gitignore b/core/function-impl/mogo-core-function-obu-mogo/.gitignore deleted file mode 100644 index 42afabfd2a..0000000000 --- a/core/function-impl/mogo-core-function-obu-mogo/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/build \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-obu-mogo/build.gradle b/core/function-impl/mogo-core-function-obu-mogo/build.gradle deleted file mode 100644 index 9bf311e83c..0000000000 --- a/core/function-impl/mogo-core-function-obu-mogo/build.gradle +++ /dev/null @@ -1,67 +0,0 @@ -plugins { - id 'com.android.library' - id 'kotlin-android' - id 'kotlin-android-extensions' - id 'kotlin-kapt' - id 'com.alibaba.arouter' -} - -android { - compileSdkVersion rootProject.ext.android.compileSdkVersion - defaultConfig { - minSdkVersion rootProject.ext.android.minSdkVersion - targetSdkVersion rootProject.ext.android.targetSdkVersion - versionCode Integer.valueOf(VERSION_CODE) - versionName getValueFromRootProperties("${project.name.replace("-", "_").toUpperCase()}_VERSION") - - testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" - consumerProguardFiles 'consumer-rules.pro' - - //ARouter apt 参数 - kapt { - useBuildCache = false - arguments { - arg("AROUTER_MODULE_NAME", project.getName()) - } - } - } - - buildTypes { - release { - minifyEnabled false - proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' - } - } - compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 - } - kotlinOptions { - jvmTarget = '1.8' - } -} - -dependencies { - - implementation rootProject.ext.dependencies.androidxappcompat - implementation rootProject.ext.dependencies.androidxconstraintlayout - implementation rootProject.ext.dependencies.arouter - implementation rootProject.ext.dependencies.rxandroid - - kapt rootProject.ext.dependencies.aroutercompiler - - if (Boolean.valueOf(USE_MAVEN_PACKAGE)) { - implementation rootProject.ext.dependencies.mogo_core_data - implementation rootProject.ext.dependencies.mogo_core_utils - } else { - implementation project(':core:mogo-core-data') - implementation project(':core:mogo-core-utils') - implementation project(':core:mogo-core-function-call') - } - - implementation rootProject.ext.dependencies.mogoobuold - implementation rootProject.ext.dependencies.mogoobu - -} - -apply from: new File(rootProject.rootDir, "gradle/upload.gradle").toString() \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-obu-mogo/consumer-rules.pro b/core/function-impl/mogo-core-function-obu-mogo/consumer-rules.pro deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/core/function-impl/mogo-core-function-obu-mogo/gradle.properties b/core/function-impl/mogo-core-function-obu-mogo/gradle.properties deleted file mode 100644 index 0d4b689fa3..0000000000 --- a/core/function-impl/mogo-core-function-obu-mogo/gradle.properties +++ /dev/null @@ -1,3 +0,0 @@ -GROUP=com.mogo.eagle.core.function.impl -POM_ARTIFACT_ID=obu-mogo -VERSION_CODE=1 diff --git a/core/function-impl/mogo-core-function-obu-mogo/proguard-rules.pro b/core/function-impl/mogo-core-function-obu-mogo/proguard-rules.pro deleted file mode 100644 index 481bb43481..0000000000 --- a/core/function-impl/mogo-core-function-obu-mogo/proguard-rules.pro +++ /dev/null @@ -1,21 +0,0 @@ -# Add project specific ProGuard rules here. -# You can control the set of applied configuration files using the -# proguardFiles setting in build.gradle. -# -# For more details, see -# http://developer.android.com/guide/developing/tools/proguard.html - -# If your project uses WebView with JS, uncomment the following -# and specify the fully qualified class name to the JavaScript interface -# class: -#-keepclassmembers class fqcn.of.javascript.interface.for.webview { -# public *; -#} - -# Uncomment this to preserve the line number information for -# debugging stack traces. -#-keepattributes SourceFile,LineNumberTable - -# If you keep the line number information, uncomment this to -# hide the original source file name. -#-renamesourcefileattribute SourceFile \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-obu-mogo/src/main/AndroidManifest.xml b/core/function-impl/mogo-core-function-obu-mogo/src/main/AndroidManifest.xml deleted file mode 100644 index 1f72d0c85c..0000000000 --- a/core/function-impl/mogo-core-function-obu-mogo/src/main/AndroidManifest.xml +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/autopilot/IMoGoRoboBusJinlvM1StatesListener.kt b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/autopilot/IMoGoRoboBusJinlvM1StatesListener.kt index fe41e2e245..6f2b6348d7 100644 --- a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/autopilot/IMoGoRoboBusJinlvM1StatesListener.kt +++ b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/autopilot/IMoGoRoboBusJinlvM1StatesListener.kt @@ -1,6 +1,5 @@ package com.mogo.eagle.core.function.api.autopilot -import chassis.ChassisStatesOuterClass import chassis.VehicleStateOuterClass /** diff --git a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerAutoPilotStatusListenerManager.kt b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerAutoPilotStatusListenerManager.kt index a19f54dc4f..e158d6bced 100644 --- a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerAutoPilotStatusListenerManager.kt +++ b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerAutoPilotStatusListenerManager.kt @@ -10,9 +10,9 @@ import mogo_msg.MogoReportMsg import system_master.SystemStatusInfo /** - * @author xiaoyuzhou - * @date 2021/9/30 5:48 下午 * 域控制器相关的回调监听 + * @date 2021/9/30 5:48 下午 + * @author xiaoyuzhou */ object CallerAutoPilotStatusListenerManager : CallerBase() { diff --git a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/REEADME.md b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/REEADME.md index 6d3fa01f95..313da68621 100644 --- a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/REEADME.md +++ b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/REEADME.md @@ -1,6 +1,58 @@ -#### CallerAutoPilotStatusListenerManager 管理自动驾驶中的状态及参数信息 +#### 管理与工控机相关的数据回掉 + +``` kotlin +/** + * 添加 监听 + * @param tag 标记,用来注销监听使用 + * @param listener 监听回调 + */ +fun addListener( + tag: String, + listener: T +) + +/** + * 在添加了监听后执行 + */ +open fun doSomeAfterAddListener(tag: String, listener: T) + +/** + * 删除监听 + * @param tag 标记,用来注销监听使用 + */ +fun removeListener(tag: String) + +/** + * 删除监听 + * @param listener 要删除的监听对象 + */ +fun removeListener(listener: T) +``` + +CallerAutopilotActionsListenerManager +CallerAutopilotCarConfigListenerManager +CallerAutopilotIdentifyListenerManager +CallerAutoPilotManager +CallerAutopilotPointCloudListenerManager +CallerAutopilotRecordListenerManager +CallerAutopilotStatisticsListenerManager +CallerAutoPilotStatusListenerManager +CallerAutopilotVehicleStateListenerManager +CallerBatteryManagementSystemListenerManager +CallerChassisAccStateListenerManager +CallerChassisBrakeStateListenerManager +CallerChassisGearStateListenerManager +CallerChassisLamplightListenerManager +CallerChassisLocationGCJ20ListenerManager +CallerChassisLocationWGS84ListenerManager +CallerChassisSteeringStateListenerManager +CallerChassisThrottleStateListenerManager +CallerPlanningActionsListenerManager +CallerPlanningRottingListenerManager +CallerPlanningTrajectoryListenerManager +CallerRoboBusJinlvM1StatesListenerManager +CallerStartAutopilotFailedListenerManager +CallerSweeperFutianCleanSystemListenerManager + + -AutopilotStatusInfo: -连接信息 -实时经纬度、速度、车辆硬件状态 -最后一次启动自动驾驶时候的启动参数 AutopilotControlParameters diff --git a/modules.txt b/modules.txt index 4286b0eb33..775878c1c2 100644 --- a/modules.txt +++ b/modules.txt @@ -18,7 +18,7 @@ :test:crashreport-apm :test:crashreport-noop :test:crashreport-upgrade -:core:function-impl:mogo-core-function-obu-mogo +:core:function-impl:mogo-core-function-datacenter :core:function-impl:mogo-core-function-hmi :core:function-impl:mogo-core-function-map :core:function-impl:mogo-core-function-v2x diff --git a/settings.gradle b/settings.gradle index c262ab3649..4954d993e1 100644 --- a/settings.gradle +++ b/settings.gradle @@ -28,13 +28,11 @@ include ':core:function-impl:mogo-core-function-hmi' include ':core:function-impl:mogo-core-function-map' // v2x预警业务,本地+云端预警 include ':core:function-impl:mogo-core-function-v2x' -// 自研OBU业务 -include ':core:function-impl:mogo-core-function-obu-mogo' // 车聊聊业务 include ':core:function-impl:mogo-core-function-chat' // 业务biz include ':core:function-impl:mogo-core-function-biz' -// 消息盒子 +// 消息盒子、自研OBU业务 include ':core:function-impl:mogo-core-function-datacenter' // 模块 From fa04ed406eadcdb38157f040b5486c04e87059e7 Mon Sep 17 00:00:00 2001 From: lixiaopeng Date: Mon, 30 Jan 2023 17:49:17 +0800 Subject: [PATCH 05/18] =?UTF-8?q?=E5=8E=BB=E6=8E=89=E8=80=81obu=E7=9A=84?= =?UTF-8?q?=E5=8A=9F=E8=83=BD=EF=BC=8C=E5=90=88=E5=B9=B6EventTypeEnumNew?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config.gradle | 4 +- .../redlightwarning/RedLightWarningManager.kt | 26 +- .../function/biz/v2x/vip/VipCarManager.kt | 34 +- .../build.gradle | 1 - .../mogo-core-function-hmi/build.gradle | 2 - .../receiver/V2XWarningBroadcastReceiver.kt | 4 +- .../core/function/hmi/ui/MoGoHmiFragment.kt | 23 +- .../adapter/DriverMsgBoxBubbleAdapter.kt | 3 +- .../msgbox/adapter/DriverMsgBoxListAdapter.kt | 3 +- .../adapter/PassengerMsgBoxBubbleAdapter.kt | 6 +- .../adapter/PassengerMsgBoxListAdapter.kt | 4 +- .../hmi/ui/setting/DebugSettingView.kt | 4 +- .../function/hmi/ui/takeover/TakeOverView.kt | 10 +- .../function/main/MainMoGoApplication.java | 3 +- .../impl/marker/drawer/MarkerDrawer.java | 4 +- .../mogo-core-function-obu-mogo/build.gradle | 1 - .../core/function/obu/mogo/MoGoObuProvider.kt | 13 +- .../obu/mogo/MogoPrivateObuManager.kt | 1001 ----------------- .../obu/mogo/MogoPrivateObuNewManager.kt | 12 +- .../obu/mogo/utils/TrafficDataConvertUtils.kt | 133 --- .../v2x/events/alarm/V2XAlarmServer.java | 8 +- .../manager/impl/MoGoV2XMarkerManager.java | 12 +- .../v2x/events/marker/V2XMarkerAdapter.java | 18 +- .../v2x/events/view/V2XMarkerRoadEventView.kt | 10 +- .../core/data/config/CloudPoiManager.java | 31 +- .../eagle/core/data/enums/EventTypeEnumNew.kt | 16 + .../eagle/core/data/enums/EventTypeHelper.kt | 68 +- .../data/map/entity/V2XRoadEventEntity.java | 13 +- 28 files changed, 156 insertions(+), 1311 deletions(-) delete mode 100644 core/function-impl/mogo-core-function-obu-mogo/src/main/java/com/mogo/eagle/core/function/obu/mogo/MogoPrivateObuManager.kt delete mode 100644 core/function-impl/mogo-core-function-obu-mogo/src/main/java/com/mogo/eagle/core/function/obu/mogo/utils/TrafficDataConvertUtils.kt diff --git a/config.gradle b/config.gradle index 9c6fdcf353..f93598a206 100644 --- a/config.gradle +++ b/config.gradle @@ -91,9 +91,7 @@ ext { // obu sdk obusdk : "com.zhidao.enterprise.smartv2x:smartv2x:1.0.0.3", - mogoobuold : 'com.zhidao.support.obu:mogoobu:1.0.0.33', - mogoobu : 'com.mogo.support.obu:mogo-obu:1.0.6', - mogoami : 'com.zhidao.support.obu.ami:mogoami:1.0.0.24', + mogoobu : 'com.mogo.support.obu:mogo-obu:1.1.0_beta0', // google googlezxing : "com.google.zxing:core:3.3.3", diff --git a/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/redlightwarning/RedLightWarningManager.kt b/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/redlightwarning/RedLightWarningManager.kt index 6b07d8fc61..283bd2d5fd 100644 --- a/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/redlightwarning/RedLightWarningManager.kt +++ b/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/redlightwarning/RedLightWarningManager.kt @@ -4,7 +4,7 @@ import android.util.Log import com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig.Companion.BIZ_IVP import com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig.Companion.BIZ_IVP_GREEN import com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig.Companion.V2I -import com.mogo.eagle.core.data.enums.EventTypeEnum +import com.mogo.eagle.core.data.enums.EventTypeEnumNew import com.mogo.eagle.core.data.map.MogoLatLng import com.mogo.eagle.core.data.msgbox.MsgBoxBean import com.mogo.eagle.core.data.msgbox.MsgBoxType @@ -209,17 +209,17 @@ class RedLightWarningManager : IMoGoTrafficLightListener, IMoGoVipSetListener, MsgBoxBean( MsgBoxType.V2X, V2XMsg( - EventTypeEnum.TYPE_USECASE_ID_IVP.poiType, - EventTypeEnum.TYPE_USECASE_ID_IVP.content, - EventTypeEnum.TYPE_USECASE_ID_IVP.tts + EventTypeEnumNew.TYPE_USECASE_ID_IVP_RED.poiType, + EventTypeEnumNew.TYPE_USECASE_ID_IVP_RED.content, + EventTypeEnumNew.TYPE_USECASE_ID_IVP_RED.tts ) ) ) CallerHmiManager.warningV2X( - EventTypeEnum.TYPE_USECASE_ID_IVP.poiType, - EventTypeEnum.TYPE_USECASE_ID_IVP.content, - EventTypeEnum.TYPE_USECASE_ID_IVP.tts, - EventTypeEnum.TYPE_USECASE_ID_IVP.poiType, + EventTypeEnumNew.TYPE_USECASE_ID_IVP_RED.poiType, + EventTypeEnumNew.TYPE_USECASE_ID_IVP_RED.content, + EventTypeEnumNew.TYPE_USECASE_ID_IVP_RED.tts, + EventTypeEnumNew.TYPE_USECASE_ID_IVP_RED.poiType, null, true, 5000L @@ -235,11 +235,11 @@ class RedLightWarningManager : IMoGoTrafficLightListener, IMoGoVipSetListener, CallerLogger.d("$M_V2X$TAG", "=====绿灯通行预警=====") ThreadUtils.runOnUiThread { val content = String.format( - EventTypeEnum.getWarningContent(EventTypeEnum.TYPE_USECASE_ID_IVP_GREEN.poiType), + EventTypeEnumNew.getWarningContent(EventTypeEnumNew.TYPE_USECASE_ID_IVP_GREEN.poiType), speed ) val tts = String.format( - EventTypeEnum.getWarningTts(EventTypeEnum.TYPE_USECASE_ID_IVP_GREEN.poiType), + EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_USECASE_ID_IVP_GREEN.poiType), speed ) if (content.isNullOrEmpty() || tts.isNullOrEmpty()) { @@ -249,17 +249,17 @@ class RedLightWarningManager : IMoGoTrafficLightListener, IMoGoVipSetListener, MsgBoxBean( MsgBoxType.V2X, V2XMsg( - EventTypeEnum.TYPE_USECASE_ID_IVP_GREEN.poiType, + EventTypeEnumNew.TYPE_USECASE_ID_IVP_GREEN.poiType, content, tts ) ) ) CallerHmiManager.warningV2X( - EventTypeEnum.TYPE_USECASE_ID_IVP_GREEN.poiType, + EventTypeEnumNew.TYPE_USECASE_ID_IVP_GREEN.poiType, content, tts, - EventTypeEnum.TYPE_USECASE_ID_IVP_GREEN.poiType, + EventTypeEnumNew.TYPE_USECASE_ID_IVP_GREEN.poiType, null, true, 5000L diff --git a/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/vip/VipCarManager.kt b/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/vip/VipCarManager.kt index eef302a909..b3701db467 100644 --- a/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/vip/VipCarManager.kt +++ b/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/vip/VipCarManager.kt @@ -10,7 +10,7 @@ import com.mogo.aicloud.services.socket.MogoAiCloudSocketManager import com.mogo.cloud.passport.MoGoAiCloudClientConfig import com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig.Companion.BIZ_VIP import com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig.Companion.V2N -import com.mogo.eagle.core.data.enums.EventTypeEnum +import com.mogo.eagle.core.data.enums.EventTypeEnumNew import com.mogo.eagle.core.data.msgbox.MsgBoxBean import com.mogo.eagle.core.data.msgbox.MsgBoxType import com.mogo.eagle.core.data.msgbox.V2XMsg @@ -209,17 +209,17 @@ class VipCarManager : IMogoOnMessageListener, IMoGoTrafficLightListe val light = this.result?.currentRoadTrafficLight() if (light != null && light.isGreen()) { showWarning( - EventTypeEnum.TYPE_VIP_IDENTIFICATION_EXTEND.poiType, - EventTypeEnum.TYPE_VIP_IDENTIFICATION_EXTEND.content, - EventTypeEnum.TYPE_VIP_IDENTIFICATION_EXTEND.tts, - EventTypeEnum.TYPE_VIP_IDENTIFICATION_EXTEND.poiType + EventTypeEnumNew.TYPE_VIP_IDENTIFICATION_EXTEND.poiType, + EventTypeEnumNew.TYPE_VIP_IDENTIFICATION_EXTEND.content, + EventTypeEnumNew.TYPE_VIP_IDENTIFICATION_EXTEND.tts, + EventTypeEnumNew.TYPE_VIP_IDENTIFICATION_EXTEND.poiType ) } else { showWarning( - EventTypeEnum.TYPE_VIP_IDENTIFICATION_PASS.poiType, - EventTypeEnum.TYPE_VIP_IDENTIFICATION_PASS.content, - EventTypeEnum.TYPE_VIP_IDENTIFICATION_PASS.tts, - EventTypeEnum.TYPE_VIP_IDENTIFICATION_PASS.poiType + EventTypeEnumNew.TYPE_VIP_IDENTIFICATION_PASS.poiType, + EventTypeEnumNew.TYPE_VIP_IDENTIFICATION_PASS.content, + EventTypeEnumNew.TYPE_VIP_IDENTIFICATION_PASS.tts, + EventTypeEnumNew.TYPE_VIP_IDENTIFICATION_PASS.poiType ) } return@turnLightToGreen @@ -228,10 +228,10 @@ class VipCarManager : IMogoOnMessageListener, IMoGoTrafficLightListe // 请求变灯失败,根据灯态来提示。 此处灯态未获取到 if (this.result == null || this.result?.currentRoadTrafficLight() == null) { showWarning( - EventTypeEnum.TYPE_VIP_ERROR_IDENTIFICATION.poiType, - EventTypeEnum.TYPE_VIP_ERROR_IDENTIFICATION.content + ", 稍后重试", - EventTypeEnum.TYPE_VIP_ERROR_IDENTIFICATION.tts, - EventTypeEnum.TYPE_VIP_ERROR_IDENTIFICATION.poiType + EventTypeEnumNew.TYPE_VIP_ERROR_IDENTIFICATION.poiType, + EventTypeEnumNew.TYPE_VIP_ERROR_IDENTIFICATION.content + ", 稍后重试", + EventTypeEnumNew.TYPE_VIP_ERROR_IDENTIFICATION.tts, + EventTypeEnumNew.TYPE_VIP_ERROR_IDENTIFICATION.poiType ) return@turnLightToGreen } @@ -249,10 +249,10 @@ class VipCarManager : IMogoOnMessageListener, IMoGoTrafficLightListe "${temp}秒后重试" } showWarning( - EventTypeEnum.TYPE_VIP_ERROR_IDENTIFICATION.poiType, - EventTypeEnum.TYPE_VIP_ERROR_IDENTIFICATION.content + time, - EventTypeEnum.TYPE_VIP_ERROR_IDENTIFICATION.tts, - EventTypeEnum.TYPE_VIP_ERROR_IDENTIFICATION.poiType + EventTypeEnumNew.TYPE_VIP_ERROR_IDENTIFICATION.poiType, + EventTypeEnumNew.TYPE_VIP_ERROR_IDENTIFICATION.content + time, + EventTypeEnumNew.TYPE_VIP_ERROR_IDENTIFICATION.tts, + EventTypeEnumNew.TYPE_VIP_ERROR_IDENTIFICATION.poiType ) } else { CallerLogger.d( diff --git a/core/function-impl/mogo-core-function-datacenter/build.gradle b/core/function-impl/mogo-core-function-datacenter/build.gradle index b6e5f51262..a4c999e435 100644 --- a/core/function-impl/mogo-core-function-datacenter/build.gradle +++ b/core/function-impl/mogo-core-function-datacenter/build.gradle @@ -54,7 +54,6 @@ dependencies { kapt rootProject.ext.dependencies.androidxroomcompiler implementation rootProject.ext.dependencies.androidxroomktx - implementation rootProject.ext.dependencies.mogoami implementation rootProject.ext.dependencies.mogoaicloudtelematic if (Boolean.valueOf(USE_MAVEN_PACKAGE)) { diff --git a/core/function-impl/mogo-core-function-hmi/build.gradle b/core/function-impl/mogo-core-function-hmi/build.gradle index df17cbf358..26c469da4b 100644 --- a/core/function-impl/mogo-core-function-hmi/build.gradle +++ b/core/function-impl/mogo-core-function-hmi/build.gradle @@ -72,8 +72,6 @@ dependencies { implementation rootProject.ext.dependencies.arouter kapt rootProject.ext.dependencies.aroutercompiler - implementation rootProject.ext.dependencies.mogoami - implementation rootProject.ext.dependencies.android_start_up implementation rootProject.ext.dependencies.cicle_indicator implementation rootProject.ext.dependencies.koomnative diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/receiver/V2XWarningBroadcastReceiver.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/receiver/V2XWarningBroadcastReceiver.kt index 3a60406e12..30f289c218 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/receiver/V2XWarningBroadcastReceiver.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/receiver/V2XWarningBroadcastReceiver.kt @@ -4,11 +4,11 @@ import android.content.BroadcastReceiver import android.content.Context import android.content.Intent import android.util.Log +import com.mogo.eagle.core.data.enums.EventTypeEnumNew import com.mogo.eagle.core.function.call.hmi.CallerHmiManager import com.mogo.eagle.core.function.hmi.WaringConst import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_HMI -import com.mogo.eagle.core.data.enums.EventTypeEnum import com.mogo.eagle.core.data.msgbox.MsgBoxBean import com.mogo.eagle.core.data.msgbox.MsgBoxType import com.mogo.eagle.core.data.msgbox.V2XMsg @@ -75,7 +75,7 @@ class V2XWarningBroadcastReceiver : BroadcastReceiver() { ttsContent: String?, tag: String? ) { - if (EventTypeEnum.TYPE_USECASE_ID_IVP.poiType == v2xType.toString()) { + if (EventTypeEnumNew.TYPE_USECASE_ID_IVP_RED.poiType == v2xType.toString()) { CallerHmiManager.showLimitingVelocity(1, 1) } if (alertContent.isNullOrEmpty() || ttsContent.isNullOrEmpty()) { diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/MoGoHmiFragment.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/MoGoHmiFragment.kt index a0ac521b3a..9f482ca275 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/MoGoHmiFragment.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/MoGoHmiFragment.kt @@ -3,7 +3,7 @@ package com.mogo.eagle.core.function.hmi.ui import android.content.Context import android.os.Bundle import android.text.TextUtils -import android.util.* +import android.util.Log import android.view.View import android.view.ViewGroup import android.view.animation.AlphaAnimation @@ -24,16 +24,12 @@ import com.mogo.eagle.core.data.constants.MoGoFragmentPaths import com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig.Companion.BIZ_RTS import com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig.Companion.V2I import com.mogo.eagle.core.data.dispatch.DispatchAdasAutoPilotLocReceiverBean -import com.mogo.eagle.core.data.enums.EventTypeEnum +import com.mogo.eagle.core.data.enums.EventTypeEnumNew import com.mogo.eagle.core.data.enums.WarningDirectionEnum import com.mogo.eagle.core.data.map.Infrastructure -import com.mogo.eagle.core.data.msgbox.MsgBoxBean -import com.mogo.eagle.core.data.msgbox.MsgBoxType -import com.mogo.eagle.core.data.msgbox.RecordBagMsg import com.mogo.eagle.core.data.notice.NoticeNormalData import com.mogo.eagle.core.data.notice.NoticeTrafficStylePushData import com.mogo.eagle.core.data.report.ReportEntity -import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotRecordListener import com.mogo.eagle.core.function.api.hmi.IMoGoHmiViewProxy import com.mogo.eagle.core.function.api.hmi.view.IViewControlListener.Companion.AutoPilotStatusView_TAG import com.mogo.eagle.core.function.api.hmi.view.IViewControlListener.Companion.CameraView_TAG @@ -46,16 +42,12 @@ import com.mogo.eagle.core.function.api.hmi.view.IViewTrafficLight import com.mogo.eagle.core.function.api.hmi.warning.IMoGoHmiProvider import com.mogo.eagle.core.function.api.hmi.warning.IMoGoWarningStatusListener import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager -import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotRecordListenerManager -import com.mogo.eagle.core.function.call.biz.CallerFuncBizManager import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager import com.mogo.eagle.core.function.call.hmi.CallerHmiManager import com.mogo.eagle.core.function.call.hmi.CallerHmiViewControlListenerManager -import com.mogo.eagle.core.function.call.map.CallerMapDataCollectorManager import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager import com.mogo.eagle.core.function.call.map.CallerVisualAngleManager import com.mogo.eagle.core.function.call.map.CallerVisualAngleManager.Scene.Turning -import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxManager import com.mogo.eagle.core.function.hmi.R import com.mogo.eagle.core.function.hmi.notification.WarningFloat import com.mogo.eagle.core.function.hmi.ui.bindingcar.ModifyBindingCarDialog @@ -67,10 +59,10 @@ import com.mogo.eagle.core.function.hmi.ui.notice.NoticeCheckDialog import com.mogo.eagle.core.function.hmi.ui.notice.traffic.NoticeTrafficDialog import com.mogo.eagle.core.function.hmi.ui.setting.CameraLiveView.Companion.cameraLiveView import com.mogo.eagle.core.function.hmi.ui.setting.IPCReportWindow -import com.mogo.eagle.core.function.hmi.ui.setting.ToggleDebugView.Companion.toggleDebugView import com.mogo.eagle.core.function.hmi.ui.setting.ToolsView.Companion.toolsView import com.mogo.eagle.core.function.hmi.ui.tools.AdUpgradeDialog -import com.mogo.eagle.core.function.hmi.ui.widget.* +import com.mogo.eagle.core.function.hmi.ui.widget.DemoModeView +import com.mogo.eagle.core.function.hmi.ui.widget.StatusBarView import com.mogo.eagle.core.function.main.DisplayEffectsHelper import com.mogo.eagle.core.utilcode.kotlin.safeCancel import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils @@ -78,17 +70,12 @@ import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_HMI import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr -import com.mogo.eagle.core.utilcode.mogo.toast.TipToast import com.mogo.eagle.core.utilcode.reminder.api.IReminder import com.mogo.eagle.core.utilcode.util.ThreadUtils -import com.mogo.eagle.core.utilcode.util.TimeUtils -import com.mogo.eagle.core.utilcode.util.TimeUtils.millis2String import com.mogo.eagle.core.utilcode.util.ToastUtils -import com.zhjt.mogo_core_function_devatools.badcase.consts.BadCaseConfig import com.zhjt.service_biz.BizConfig import kotlinx.android.synthetic.main.fragment_hmi.* import kotlinx.coroutines.* -import record_cache.RecordPanelOuterClass import java.util.concurrent.atomic.AtomicReference /** @@ -326,7 +313,7 @@ class MoGoHmiFragment : MvpFragment(), playTts && !AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode) activity?.let { val warningContent = alertContent - ?: EventTypeEnum.getWarningContent(v2xType) + ?: EventTypeEnumNew.getWarningContent(v2xType) //占道施工预警 if (v2xType == "10006" || v2xType == "100061") { diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/adapter/DriverMsgBoxBubbleAdapter.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/adapter/DriverMsgBoxBubbleAdapter.kt index ab7bab281e..e6917eee75 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/adapter/DriverMsgBoxBubbleAdapter.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/adapter/DriverMsgBoxBubbleAdapter.kt @@ -8,7 +8,6 @@ import android.view.ViewGroup import android.widget.ImageView import android.widget.TextView import androidx.recyclerview.widget.RecyclerView -import com.mogo.eagle.core.data.enums.EventTypeEnum import com.mogo.eagle.core.data.enums.EventTypeEnumNew import com.mogo.eagle.core.data.msgbox.* import com.mogo.eagle.core.data.report.ReportEntity @@ -129,7 +128,7 @@ class DriverMsgBoxBubbleAdapter(private val activity: Activity) : RecyclerView.A EventTypeEnumNew.getUpdateIconRes(v2XMsg.type))) }else{ holder.ivV2XImage.setImageDrawable(activity.resources.getDrawable( - EventTypeEnum.getUpdateIconRes(v2XMsg.type))) + EventTypeEnumNew.getUpdateIconRes(v2XMsg.type))) } } } diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/adapter/DriverMsgBoxListAdapter.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/adapter/DriverMsgBoxListAdapter.kt index 65a914808d..5e02c0c918 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/adapter/DriverMsgBoxListAdapter.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/adapter/DriverMsgBoxListAdapter.kt @@ -9,7 +9,6 @@ import android.widget.ImageView import android.widget.TextView import androidx.core.view.isVisible import androidx.recyclerview.widget.RecyclerView -import com.mogo.eagle.core.data.enums.EventTypeEnum import com.mogo.eagle.core.data.enums.EventTypeEnumNew import com.mogo.eagle.core.data.msgbox.* import com.mogo.eagle.core.data.report.ReportEntity @@ -219,7 +218,7 @@ class DriverMsgBoxListAdapter(private val activity: Activity) : RecyclerView.Ada EventTypeEnumNew.getUpdateIconRes(v2XMsg.type))) }else{ holder.ivV2XImage.setImageDrawable(activity.resources.getDrawable( - EventTypeEnum.getUpdateIconRes(v2XMsg.type))) + EventTypeEnumNew.getUpdateIconRes(v2XMsg.type))) } } } diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/adapter/PassengerMsgBoxBubbleAdapter.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/adapter/PassengerMsgBoxBubbleAdapter.kt index 6b0c6750a6..858f15e6cd 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/adapter/PassengerMsgBoxBubbleAdapter.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/adapter/PassengerMsgBoxBubbleAdapter.kt @@ -8,17 +8,15 @@ import android.view.ViewGroup import android.widget.ImageView import android.widget.TextView import androidx.recyclerview.widget.RecyclerView -import com.mogo.eagle.core.data.enums.EventTypeEnum import com.mogo.eagle.core.data.enums.EventTypeEnumNew import com.mogo.eagle.core.data.msgbox.MsgBoxBean import com.mogo.eagle.core.data.msgbox.MsgBoxType import com.mogo.eagle.core.data.msgbox.NoticeFrCloudMsg import com.mogo.eagle.core.data.msgbox.V2XMsg -import com.mogo.eagle.core.utilcode.mogo.glide.GlideApp -import com.mogo.eagle.core.data.notice.NoticeNormalData import com.mogo.eagle.core.function.call.hmi.CallerHmiManager import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxManager import com.mogo.eagle.core.function.hmi.R +import com.mogo.eagle.core.utilcode.mogo.glide.GlideApp import com.mogo.eagle.core.utilcode.mogo.glide.transform.GlideRoundedCornersTransform import com.mogo.eagle.core.utilcode.util.TimeUtils import com.mogo.eagle.core.utilcode.util.TimeUtils.getHourMinFormat @@ -101,7 +99,7 @@ class PassengerMsgBoxBubbleAdapter(private val activity: Activity): RecyclerView EventTypeEnumNew.getUpdateIconRes(v2XMsg.type))) }else{ holder.ivPassengerV2XImage.setImageDrawable(activity.resources.getDrawable( - EventTypeEnum.getUpdateIconRes(v2XMsg.type))) + EventTypeEnumNew.getUpdateIconRes(v2XMsg.type))) } } } diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/adapter/PassengerMsgBoxListAdapter.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/adapter/PassengerMsgBoxListAdapter.kt index 50c635e49c..1dbb6a3be9 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/adapter/PassengerMsgBoxListAdapter.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/adapter/PassengerMsgBoxListAdapter.kt @@ -7,13 +7,11 @@ import android.view.ViewGroup import android.widget.ImageView import android.widget.TextView import androidx.recyclerview.widget.RecyclerView -import com.mogo.eagle.core.data.enums.EventTypeEnum import com.mogo.eagle.core.data.enums.EventTypeEnumNew import com.mogo.eagle.core.data.msgbox.MsgBoxBean import com.mogo.eagle.core.data.msgbox.MsgBoxType import com.mogo.eagle.core.data.msgbox.NoticeFrCloudMsg import com.mogo.eagle.core.data.msgbox.V2XMsg -import com.mogo.eagle.core.data.notice.NoticeNormalData import com.mogo.eagle.core.function.call.hmi.CallerHmiManager import com.mogo.eagle.core.function.hmi.R import com.mogo.eagle.core.utilcode.mogo.glide.GlideApp @@ -93,7 +91,7 @@ class PassengerMsgBoxListAdapter(private val activity: Activity): RecyclerView.A EventTypeEnumNew.getUpdateIconRes(v2XMsg.type))) }else{ holder.ivPassengerV2XImage.setImageDrawable(activity.resources.getDrawable( - EventTypeEnum.getUpdateIconRes(v2XMsg.type))) + EventTypeEnumNew.getUpdateIconRes(v2XMsg.type))) } } } diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/DebugSettingView.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/DebugSettingView.kt index cb59e84424..6911df61f8 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/DebugSettingView.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/DebugSettingView.kt @@ -74,7 +74,7 @@ import com.mogo.eagle.core.utilcode.mogo.toast.TipToast import com.mogo.eagle.core.utilcode.util.* import com.mogo.map.uicontroller.VisualAngleMode import com.mogo.map.uicontroller.VisualAngleMode.* -import com.zhidao.easysocket.utils.L +//import com.zhidao.easysocket.utils.L import com.zhjt.mogo_core_function_devatools.env.* import kotlinx.android.synthetic.main.view_debug_setting.view.* import mogo.telematics.pad.MessagePad @@ -1269,7 +1269,7 @@ internal class DebugSettingView @JvmOverloads constructor( * 设置是否输出OBU日志 true-打印日志,false-不打印日志 */ tbObuLog.setOnCheckedChangeListener { _, isChecked -> - L.setEnableLog(isChecked) +// L.setEnableLog(isChecked) } /** diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/takeover/TakeOverView.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/takeover/TakeOverView.kt index 23dde7c51a..4b447c2eaa 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/takeover/TakeOverView.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/takeover/TakeOverView.kt @@ -6,7 +6,7 @@ import android.view.LayoutInflater import android.view.View import androidx.constraintlayout.widget.ConstraintLayout import com.mogo.eagle.core.data.config.FunctionBuildConfig -import com.mogo.eagle.core.data.enums.EventTypeEnum +import com.mogo.eagle.core.data.enums.EventTypeEnumNew import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener import com.mogo.eagle.core.function.api.hmi.warning.IMoGoWarningStatusListener import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager @@ -56,10 +56,10 @@ class TakeOverView @JvmOverloads constructor( MogoReport.Code.Error.EMAP.EXIT_AUTOPILOT_FOR_CHASSIS, MogoReport.Code.Error.EMAP.EXIT_AUTOPILOT_FOR_DISTANCE -> { CallerHmiManager.warningV2X( - EventTypeEnum.TAKE_OVER_EVENT.poiType, - EventTypeEnum.TAKE_OVER_EVENT.content, - EventTypeEnum.TAKE_OVER_EVENT.tts, - EventTypeEnum.TAKE_OVER_EVENT.poiType, + EventTypeEnumNew.TAKE_OVER_EVENT.poiType, + EventTypeEnumNew.TAKE_OVER_EVENT.content, + EventTypeEnumNew.TAKE_OVER_EVENT.tts, + EventTypeEnumNew.TAKE_OVER_EVENT.poiType, object : IMoGoWarningStatusListener { override fun onShow() { takeOver = true diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/main/MainMoGoApplication.java b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/main/MainMoGoApplication.java index 9be0248578..d67b55b7c7 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/main/MainMoGoApplication.java +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/main/MainMoGoApplication.java @@ -34,7 +34,6 @@ import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger; import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr; import com.mogo.eagle.core.utilcode.util.ProcessUtils; import com.mogo.eagle.core.utilcode.util.SPUtils; -import com.zhidao.support.obu.ami.AmiClientManager; import java.io.File; import java.lang.reflect.Field; @@ -203,7 +202,7 @@ public abstract class MainMoGoApplication extends AbsMogoApplication { */ private void connectAmiIp() { String ipAddress = SharedPrefsMgr.getInstance(AbsMogoApplication.getApp().getBaseContext()).getString(MoGoConfig.OBU_IP, "192.168.1.199"); - AmiClientManager.getInstance().setObuIp(ipAddress); +// AmiClientManager.getInstance().setObuIp(ipAddress); } private void initModules() { diff --git a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/impl/marker/drawer/MarkerDrawer.java b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/impl/marker/drawer/MarkerDrawer.java index 63bba6385f..7195182391 100644 --- a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/impl/marker/drawer/MarkerDrawer.java +++ b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/impl/marker/drawer/MarkerDrawer.java @@ -5,6 +5,7 @@ import android.text.TextUtils; import com.mogo.cloud.commons.utils.CoordinateUtils; import com.mogo.commons.AbsMogoApplication; import com.mogo.commons.module.status.MogoStatusManager; +import com.mogo.eagle.core.data.enums.EventTypeEnumNew; import com.mogo.eagle.core.data.map.MogoLatLng; import com.mogo.eagle.core.data.map.entity.MarkerExploreWay; import com.mogo.eagle.core.data.map.entity.MarkerNoveltyInfo; @@ -19,7 +20,6 @@ import com.mogo.map.MogoMarkerManager; import com.mogo.map.marker.IMogoMarker; import com.mogo.map.marker.IMogoMarkerClickListener; import com.mogo.map.marker.MogoMarkerOptions; -import com.mogo.eagle.core.data.enums.EventTypeEnum; /** * @author congtaowang @@ -81,7 +81,7 @@ public class MarkerDrawer { Object bindObj = markerShowEntity.getBindObj(); if (bindObj instanceof MarkerExploreWay && ((MarkerExploreWay) bindObj).getPoiType() != null) { String poiType = ((MarkerExploreWay) bindObj).getPoiType(); - options.icon3DRes(EventTypeEnum.getMarker3DRes(poiType)); + options.icon3DRes(EventTypeEnumNew.getMarker3DRes(poiType)); } } diff --git a/core/function-impl/mogo-core-function-obu-mogo/build.gradle b/core/function-impl/mogo-core-function-obu-mogo/build.gradle index 9bf311e83c..5f05fb457c 100644 --- a/core/function-impl/mogo-core-function-obu-mogo/build.gradle +++ b/core/function-impl/mogo-core-function-obu-mogo/build.gradle @@ -59,7 +59,6 @@ dependencies { implementation project(':core:mogo-core-function-call') } - implementation rootProject.ext.dependencies.mogoobuold implementation rootProject.ext.dependencies.mogoobu } diff --git a/core/function-impl/mogo-core-function-obu-mogo/src/main/java/com/mogo/eagle/core/function/obu/mogo/MoGoObuProvider.kt b/core/function-impl/mogo-core-function-obu-mogo/src/main/java/com/mogo/eagle/core/function/obu/mogo/MoGoObuProvider.kt index f9c946d9f7..2f8b946bee 100644 --- a/core/function-impl/mogo-core-function-obu-mogo/src/main/java/com/mogo/eagle/core/function/obu/mogo/MoGoObuProvider.kt +++ b/core/function-impl/mogo-core-function-obu-mogo/src/main/java/com/mogo/eagle/core/function/obu/mogo/MoGoObuProvider.kt @@ -11,6 +11,7 @@ import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_OBU import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr import com.mogo.eagle.core.utilcode.util.CommonUtils +import com.mogo.support.obu.MogoObuManager /** * @author xiaoyuzhou @@ -54,9 +55,6 @@ class MoGoObuProvider : IMoGoObuProvider { ipAddress, CommonUtils.getIpAddressString() ) - - //old obu - MogoPrivateObuManager.INSTANCE.init(context, ipAddress) } else if (AppIdentityModeUtils.isTaxi(FunctionBuildConfig.appIdentityMode)) { //taxi 司机端和乘客端 val ipAddress = SharedPrefsMgr.getInstance(context).getString(MoGoConfig.OBU_IP, taxiObuIp) @@ -66,9 +64,6 @@ class MoGoObuProvider : IMoGoObuProvider { ipAddress, CommonUtils.getIpAddressString() ) - - //old obu - MogoPrivateObuManager.INSTANCE.init(context, ipAddress) } } } @@ -95,18 +90,16 @@ class MoGoObuProvider : IMoGoObuProvider { CommonUtils.getIpAddressString() ) - //连接old obu - MogoPrivateObuManager.INSTANCE.connectObu(it, ipAddress) } } } override fun disConnect() { - MogoPrivateObuManager.INSTANCE.disConnectObu() + MogoPrivateObuNewManager.INSTANCE.disconnect() } override fun isConnected(): Boolean { - return MogoPrivateObuManager.INSTANCE.isConnected() + return MogoObuManager.getInstance().connectStatus == 1 } } \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-obu-mogo/src/main/java/com/mogo/eagle/core/function/obu/mogo/MogoPrivateObuManager.kt b/core/function-impl/mogo-core-function-obu-mogo/src/main/java/com/mogo/eagle/core/function/obu/mogo/MogoPrivateObuManager.kt deleted file mode 100644 index a942a7556e..0000000000 --- a/core/function-impl/mogo-core-function-obu-mogo/src/main/java/com/mogo/eagle/core/function/obu/mogo/MogoPrivateObuManager.kt +++ /dev/null @@ -1,1001 +0,0 @@ -package com.mogo.eagle.core.function.obu.mogo - -import android.content.Context -import android.util.Log -import com.mogo.cloud.passport.MoGoAiCloudClientConfig -import com.mogo.eagle.core.data.app.AppConfigInfo -import com.mogo.eagle.core.data.config.FunctionBuildConfig -import com.mogo.eagle.core.data.enums.EventTypeEnum -import com.mogo.eagle.core.data.enums.EventTypeHelper -import com.mogo.eagle.core.data.enums.WarningDirectionEnum -import com.mogo.eagle.core.data.msgbox.MsgBoxBean -import com.mogo.eagle.core.data.msgbox.MsgBoxType -import com.mogo.eagle.core.data.msgbox.V2XMsg -import com.mogo.eagle.core.function.api.hmi.warning.IMoGoWarningStatusListener -import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager -import com.mogo.eagle.core.function.call.hmi.CallerHmiManager -import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager -import com.mogo.eagle.core.function.call.map.CallerVisualAngleManager -import com.mogo.eagle.core.function.call.map.CallerVisualAngleManager.Scene.Default -import com.mogo.eagle.core.function.call.map.CallerVisualAngleManager.Scene.TooClose -import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxManager -import com.mogo.eagle.core.function.call.obu.CallerObuListenerManager -import com.mogo.eagle.core.function.obu.mogo.utils.TrafficDataConvertUtils -import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger -import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_OBU -import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr -import com.zhidao.support.obu.MogoObuManager -import com.zhidao.support.obu.OnMogoObuListener -import com.zhidao.support.obu.constants.ObuConstants -import com.zhidao.support.obu.model.* -import com.zhidao.support.obu.model.advance.Light -import org.json.JSONObject - -/** - * - * @author lixiaopeng - * @since 2021/8/8 - * @description OBU 管理 - */ -class MogoPrivateObuManager private constructor() { - companion object { - val INSTANCE: MogoPrivateObuManager by lazy(mode = LazyThreadSafetyMode.SYNCHRONIZED) { - MogoPrivateObuManager() - } - } - - private var mContext: Context? = null - private var mObuStatusInfo = CallerObuListenerManager.getObuStatusInfo() - - fun init(context: Context, ipAddress: String) { - CallerLogger.d("$M_OBU${MogoObuConst.TAG_MOGO_OBU}", "obuManager初始化--") - mContext = context - //连接obu设备 - connectObu(context, ipAddress) - //控制日志输出 - MogoObuManager.getInstance() - .init(MoGoAiCloudClientConfig.getInstance().getSn(), AppConfigInfo.toString()) - MogoObuManager.getInstance().registerListener(mogoObuListener) - } - - fun connectObu(context: Context, ipAddress: String) { - //自研obu初始化 - mObuStatusInfo.connectIP = ipAddress - mObuStatusInfo.obuSdkVersion = MogoObuManager.getInstance().versionName - if (!MogoObuManager.getInstance().isConnected) { - MogoObuManager.getInstance().connect(context, mObuStatusInfo.connectIP) - } else { - try { - MogoObuManager.getInstance().disConnect() - Thread.sleep(500) - } catch (e: Exception) { - e.printStackTrace() - } - MogoObuManager.getInstance().connect(context, mObuStatusInfo.connectIP) - } - } - - fun disConnectObu() { - try { - MogoObuManager.getInstance().disConnect() - } catch (e: Exception) { - e.printStackTrace() - } - - } - - fun isConnected(): Boolean { - return MogoObuManager.getInstance().isConnected - } - - private val mogoObuListener: OnMogoObuListener = object : OnMogoObuListener() { - // OBU连接成功 - override fun onConnected() { - CallerLogger.d("$M_OBU${MogoObuConst.TAG_MOGO_OBU}", "onConnected ------> ") - mObuStatusInfo.obuStatus = true - CallerObuListenerManager.invokeListener(mObuStatusInfo) - mContext?.let { SharedPrefsMgr.getInstance(it).putBoolean("OBU", true) } - - //断开mogo obu - com.mogo.support.obu.MogoObuManager.getInstance().disconnect() - } - - // OBU连接失败 - override fun onConnectFail(isNeedReconnect: Boolean) { - CallerLogger.d("$M_OBU${MogoObuConst.TAG_MOGO_OBU}", "onConnectFail ------> ") - mObuStatusInfo.obuStatus = false - mObuStatusInfo.obuHvStatus = false - mObuStatusInfo.obuRvStatus = false - CallerObuListenerManager.invokeListener(mObuStatusInfo) - mContext?.let { SharedPrefsMgr.getInstance(it).putBoolean("OBU", false) } - mContext?.let { SharedPrefsMgr.getInstance(it).putBoolean("OBU_HV", false) } - mContext?.let { SharedPrefsMgr.getInstance(it).putBoolean("OBU_RV", false) } - } - - // OBU断开连接 - override fun onDisconnect() { - CallerLogger.d("$M_OBU${MogoObuConst.TAG_MOGO_OBU}", "onDisconnect ------> ") - mObuStatusInfo.obuStatus = false - mObuStatusInfo.obuHvStatus = false - mObuStatusInfo.obuRvStatus = false - CallerObuListenerManager.invokeListener(mObuStatusInfo) - mContext?.let { SharedPrefsMgr.getInstance(it).putBoolean("OBU", false) } - mContext?.let { SharedPrefsMgr.getInstance(it).putBoolean("OBU_HV", false) } - mContext?.let { SharedPrefsMgr.getInstance(it).putBoolean("OBU_RV", false) } - } - - // 接收到的原始数据 - override fun onReceiveOriginData(data: String) { - super.onReceiveOriginData(data) - CallerLogger.d( - "$M_OBU${MogoObuConst.TAG_MOGO_OBU}", - "onReceiveOriginData ------> data = $data" - ) - - } - - // 发送的数据 - override fun onSendData(bytes: ByteArray) { - super.onSendData(bytes) - CallerLogger.d("$M_OBU${MogoObuConst.TAG_MOGO_OBU}", "onSendData ------> ") - } - - // CV2X系统信息 - override fun onCvxAppInitIndInfo(info: CvxAppInitIndInfo) { - super.onCvxAppInitIndInfo(info) - CallerLogger.d( - "$M_OBU${MogoObuConst.TAG_MOGO_OBU}", - "onCvxAppInitIndInfo ------> $info" - ) - if (info != null) { - if (!info.stack_info.isNullOrEmpty()) { - mObuStatusInfo.stackInfo = info.stack_info - } - - if (!info.app_info.isNullOrEmpty()) { - mObuStatusInfo.appInfo = info.app_info - } - - if (!info.hli_info.isNullOrEmpty()) { - mObuStatusInfo.hliInfo = info.hli_info - } - CallerObuListenerManager.invokeListener(mObuStatusInfo) - } - } - - // (2) 车辆信息:CVX_HV_INFO_IND - override fun onCvxHvInfoIndInfo(info: CvxHvInfoIndInfo?) { - mContext?.let { SharedPrefsMgr.getInstance(it).putBoolean("OBU_HV", true) } - mObuStatusInfo.obuHvStatus = true - CallerObuListenerManager.invokeListener(mObuStatusInfo) - CallerLogger.d("$M_OBU${MogoObuConst.TAG_MOGO_OBU}", "onCvxHvInfoIndInfo ------> $info") - if (info != null && info.basic_info != null && info.basic_info.position != null) { - val movingObjectInfo = info.basic_info - val position = movingObjectInfo.position - val data = JSONObject() - try { - data.putOpt("lon", position.longitude) - data.putOpt("lat", position.latitude) - data.putOpt("speed", movingObjectInfo.speed) - data.putOpt("heading", movingObjectInfo.heading) - if (info.acceleration_set != null) { - data.putOpt("acceleration", info.acceleration_set.lateral) - data.putOpt("yawRate", info.acceleration_set.yaw_rate) - } - try { - data.putOpt("systemTime", System.currentTimeMillis()) - } catch (e: Exception) { - e.printStackTrace() - } - try { - data.putOpt("satelliteTime", System.currentTimeMillis()) - } catch (e: Exception) { - e.printStackTrace() - } - - // 使用与渠道配置一样的gps提供者提供的数据,app/productFlavors/fPadLenovo.gradle GPS_PROVIDER 0-Android系统,1-工控机,2-OBU - if (2 == FunctionBuildConfig.gpsProvider) { - // 同步给MAP地图 - CallerMapUIServiceManager.getMapUIController()?.syncLocation2Map(data) - // 同步更新经纬度和系统时间至 AutoPilotStatusListener - CallerAutoPilotStatusListenerManager.updateAutoPilotLatLon( - System.currentTimeMillis() / 1000.0, - position.longitude, - position.latitude - ) - } - - } catch (e: Exception) { - e.printStackTrace() - } - } - } - - // (3) 远车信息:CVX_RV_INFO_IND - override fun onCvxRvInfoIndInfo(info: CvxRvInfoIndInfo) { - CallerLogger.d("$M_OBU${MogoObuConst.TAG_MOGO_OBU}", "onCvxRvInfoIndInfo ------> $info") - mObuStatusInfo.obuRvStatus = true - CallerObuListenerManager.invokeListener(mObuStatusInfo) - mContext?.let { SharedPrefsMgr.getInstance(it).putBoolean("OBU_RV", true) } - // 更新数据 - TrafficDataConvertUtils.cvxRvInfoIndInfo2TrafficData(info)?.let { - CallerMapUIServiceManager.getMarkerService()?.updateITrafficLocationInfo(it) - } - } - - // (3) 道路事件预警信息:CVX_RTI_THREAT_IND - override fun onCvxRtiThreatIndInfo(info: CvxRtiThreatIndInfo?) { -// if (HmiBuildConfig.isShowObuV2iView) { - CallerLogger.d( - "$M_OBU${MogoObuConst.TAG_MOGO_OBU}", - "onCvxRtiThreatIndInfo ------> $info" - ) - - if (info != null && info.threat_info != null && info.ext_info != null) { - var alertContent = "" - var ttsContent = "" - var appId = info.threat_info.app_id.toString() - val status = info.status - val level = info.threat_info.threat_level - val direction = - getMessageDirection(if (info.ext_info != null) info.ext_info.pos_classification else -1) - CallerLogger.d( - "$M_OBU${MogoObuConst.TAG_MOGO_OBU}", - "onCvxRtiThreatIndInfo direction = $direction -- pos_classification = ${info.ext_info.pos_classification}" - ) - CallerLogger.d( - "$M_OBU${MogoObuConst.TAG_MOGO_OBU}", - "onCvxRtiThreatIndInfo appId = $appId --status = $status --level = $level -- handleDirection = $direction --rtiType = ${info.ext_info.rti_type} --direction = $direction -- pos_classification = ${info.ext_info.pos_classification} " - ) - when (appId) { - // 道路危险情况预警 - EventTypeEnum.TYPE_USECASE_ID_HLW.poiType, - EventTypeEnum.TYPE_USECASE_ID_IVS.poiType - -> { - when (info.ext_info.rti_type) { - //急转弯 - 0x2 -> { - // 特殊处理左、右方向的 - when (direction) { - WarningDirectionEnum.ALERT_WARNING_LEFT, - WarningDirectionEnum.ALERT_WARNING_TOP_LEFT, - WarningDirectionEnum.ALERT_WARNING_BOTTOM_LEFT -> { - appId = - EventTypeEnum.TYPE_USECASE_ID_ROAD_TURN_LEFT_SHARP.poiType - } - WarningDirectionEnum.ALERT_WARNING_RIGHT, - WarningDirectionEnum.ALERT_WARNING_TOP_RIGHT, - WarningDirectionEnum.ALERT_WARNING_BOTTOM_RIGHT -> { - appId = - EventTypeEnum.TYPE_USECASE_ID_ROAD_TURN_RIGHT_SHARP.poiType - } - } - } - //施工 - 0x7 -> { - appId = EventTypeEnum.FOURS_ROAD_WORK.poiType - } - //限速 - 0xA -> { - appId = EventTypeEnum.TYPE_USECASE_ID_SLW.poiType - } - //事故 - 0xC -> { - appId = - EventTypeEnum.TYPE_USECASE_ID_ROAD_COLLISION_WARNING.poiType - } - //拥堵 - 0xD -> { - appId = EventTypeEnum.TYPE_USECASE_ID_TJW.poiType - } - //行人 - 0xF -> { - appId = - EventTypeEnum.TYPE_USECASE_ID_ROAD_PEDESTRIAN_CROSSING.poiType - } - //禁止停车 - 0x13 -> { - appId = EventTypeEnum.TYPE_USECASE_ID_ROAD_NO_PARKING.poiType - } - //学校 - 0x14 -> { - appId = - EventTypeEnum.TYPE_USECASE_ID_ROAD_PEDESTRIAN_SCHOOL.poiType - } - //桥梁 - 0x17 -> { - appId = EventTypeEnum.TYPE_USECASE_ID_ROAD_HUMP_BRIDGE.poiType - } - //轻轨电车 - 0x18 -> { - appId = EventTypeEnum.TYPE_USECASE_ID_ROAD_TRAMCAR.poiType - } - //人行横道 - 0x19 -> { - appId = - EventTypeEnum.TYPE_USECASE_ID_ROAD_PEDESTRIAN_CROSSING.poiType - } - //减速慢行 - 0x1A -> { - appId = EventTypeEnum.TYPE_USECASE_ID_ROAD_GIVE_WAY.poiType - } - //事故易发路段 - 0x1B -> { - appId = EventTypeEnum.TYPE_USECASE_ID_ROAD_COLLISION_WARNING.poiType - } - //环岛行驶 - 0x1C -> { - appId = EventTypeEnum.TYPE_USECASE_ID_ROAD_ROUNDABOUTPNG.poiType - } - //环岛行驶 - 0x1D -> { - appId = EventTypeEnum.TYPE_USECASE_ID_ROAD_TEST_SECTION.poiType - } - //驼峰桥 - 0x1E -> { - appId = EventTypeEnum.TYPE_USECASE_ID_ROAD_HUMP_BRIDGE.poiType - } - } - alertContent = EventTypeEnum.getWarningContent(appId) - ttsContent = EventTypeEnum.getWarningTts(appId) - } - // 前方拥堵提醒 - EventTypeEnum.TYPE_USECASE_ID_TJW.poiType -> { - ttsContent = EventTypeEnum.getWarningTts(appId) - if (info.threat_info != null) { - CallerLogger.d( - "$M_OBU${MogoObuConst.TAG_MOGO_OBU}", - "ttsContent = $ttsContent --alertContent = $alertContent ---info.threat_info.distance = ${info.threat_info.distance} " - ) - if (info.threat_info.distance.toInt() != 0) { - alertContent = String.format( - EventTypeEnum.getWarningContent(appId), - info.threat_info.distance.toInt() - ) - } else { - alertContent = "前方拥堵,减速慢行" - } - } - - CallerLogger.d( - "$M_OBU${MogoObuConst.TAG_MOGO_OBU}", - "ttsContent = $ttsContent --alertContent = $alertContent" - ) - } - } - - when (status) { - // 添加 - ObuConstants.STATUS.ADD -> { - //不显示弹框,其它保留 - CallerLogger.d("$M_OBU${MogoObuConst.TAG_MOGO_OBU}", "old onCvxRtiThreatIndInfo ------> appId = $appId --- alertContent = $alertContent --- ttsContent = $ttsContent ") - if (alertContent.isNullOrEmpty() || ttsContent.isNullOrEmpty()) { - Log.d("MsgBox-PriObuManager4", "alertContent或ttsContent为空!") - } - CallerMsgBoxManager.saveMsgBox( - MsgBoxBean( - MsgBoxType.OBU, - V2XMsg(appId, - alertContent, - ttsContent) - ) - ) - CallerHmiManager.warningV2X( - appId, - alertContent, - ttsContent,// 只有第一次才tts,防止更新的时候不断的提醒 - (appId + direction.direction).toString(),//使用当前事件类型+方向记录tag,当发生变化的时候关闭当前弹出新的 - object : IMoGoWarningStatusListener { - override fun onDismiss() { - // 关闭警告红边 - CallerHmiManager.showWarning(WarningDirectionEnum.ALERT_WARNING_NON) - } - }, - true, - 5000L - ) - } - - ObuConstants.STATUS.UPDATE -> { - //显示警告红边 TODO 需要确定是什么值 -// CallerHmiManager.showWarning(direction) - - // 更新数据 - TrafficDataConvertUtils.cvxRtiThreatIndInfo2TrafficData(info)?.let { - CallerObuListenerManager.invokeTrackerWarningInfo(it) - CallerMapUIServiceManager.getMarkerService() - ?.updateITrafficThreatLevelInfo(it) - } - } - - // 删除 - ObuConstants.STATUS.DELETE -> { - // 关闭警告红边 - CallerHmiManager.showWarning(WarningDirectionEnum.ALERT_WARNING_NON) - // 移除顶部弹窗 -// CallerHmiManager.disableWarningV2X((appId + direction.direction).toString()) - // 更新数据 - TrafficDataConvertUtils.cvxRtiThreatIndInfo2TrafficData(info)?.let { - CallerObuListenerManager.removeTrackerWarningInfo(it) - // 事件结束,还原车辆颜色 - it.threatLevel = 0x01 - CallerMapUIServiceManager.getMarkerService() - ?.updateITrafficThreatLevelInfo(it) - } - } - } - } -// } - } - - // (4) V2I预警信息:CVX_IVP_THREAT_IND,红绿灯 - override fun onCvxIvpThreatIndInfo(info: CvxIvpThreatIndInfo?) { - CallerLogger.d( - "$M_OBU${MogoObuConst.TAG_MOGO_OBU}", - "CvxIvpThreatIndInfo ------> $info" - ) - if (info != null && info.ext_info != null - && info.threat_info != null - && info.ext_info.lights != null - && info.ext_info.lights.isNotEmpty() - ) { -// if (HmiBuildConfig.isShowObuV2iView) { - handlerTrafficLight( - info.threat_info.app_id, - info.status, - info.ext_info.lights, - info.ext_info.index - ) -// } - } - } - - // (2) 弱势交通参与者预警信息:CVX_PTC_THREAT_IND - override fun onCvxPtcThreatIndInfo(info: CvxPtcThreatIndInfo?) { -// if (HmiBuildConfig.isShowObuV2iView) { - CallerLogger.d( - "$M_OBU${MogoObuConst.TAG_MOGO_OBU}", - "onCvxPtcInfoIndInfo ------> $info" - ) - // 交通参与者类型 0x0:未知 UNKNOWN | 0x1:非机动车 NON_MOTOR | 0x2:行人 PEDESTRIAN 0x3:RSU - if (info != null && (info.ptc_type == 1 || info.ptc_type == 2)) { - //v2i数据传输延迟 -// val hvMillTime = info.threat_info.hv_time.millisecond -// val hvSecondMillTime = (info.threat_info.hv_time.second) * 1000 -// val hvTime = hvMillTime + hvSecondMillTime -// val currentTime = TimeUtils.getNowMills() % 60000 -// val delayTime = currentTime - hvTime - -// CallerObuListenerManager.invokeDelayTime(delayTime) -// CallerLogger.d( -// "$M_OBU${MogoObuConst.TAG_MOGO_OBU}", -// "onCvxPtcInfoIndInfo ---delayTime---> $delayTime" -// ) - - CallerLogger.d( - "$M_OBU${MogoObuConst.TAG_MOGO_OBU}", - "onCvxPtcInfoIndInfo ---status---> ${info.status}" - ) - var v2xType = "" - if (info.ptc_type == 1) { //摩托车 - v2xType = EventTypeEnum.TYPE_USECASE_ID_VRUCW_MOTORBIKE.poiType - } else if (info.ptc_type == 2) { //行人 - v2xType = EventTypeEnum.TYPE_USECASE_ID_VRUCW_PERSON.poiType - } - val ttsContent = EventTypeEnum.getWarningTts(v2xType) - val alertContent = EventTypeEnum.getWarningContent(v2xType) - val direction = - getMessageDirection(if (info.ext_info != null) info.ext_info.target_classification else -1) - val level = if (info.threat_info != null) info.threat_info.threat_level else -1 - - when (info.status) { - // 添加 - ObuConstants.STATUS.ADD -> { - // if (level == 2 || level == 3) { //不考虑level - //显示警告红边 - CallerHmiManager.showWarning(direction) - CallerLogger.d("$M_OBU${MogoObuConst.TAG_MOGO_OBU}", "old onCvxPtcThreatIndInfo ------> v2xType = $v2xType --- alertContent = $alertContent --- ttsContent = $ttsContent ") - if (alertContent.isNullOrEmpty() || ttsContent.isNullOrEmpty()) { - Log.d("MsgBox-PriObuManager5", "alertContent或ttsContent为空!") - } - CallerMsgBoxManager.saveMsgBox( - MsgBoxBean( - MsgBoxType.OBU, - V2XMsg(v2xType, - alertContent, - ttsContent) - ) - ) - CallerHmiManager.warningV2X( - v2xType, - alertContent, - ttsContent,// 只有第一次才tts,防止更新的时候不断的提醒 - (v2xType + direction.direction).toString(),//使用当前事件类型+方向记录tag,当发生变化的时候关闭当前弹出新的 - object : IMoGoWarningStatusListener { - override fun onDismiss() { - // 关闭警告红边 - CallerHmiManager.showWarning(WarningDirectionEnum.ALERT_WARNING_NON) - } - }, - true, - 5000L - ) -// } - - // 更新数据 - TrafficDataConvertUtils.cvxPtcThreatIndInfo2TrafficData(info)?.let { - CallerObuListenerManager.invokeTrackerWarningInfo(it) - CallerMapUIServiceManager.getMarkerService() - ?.updateITrafficThreatLevelInfo(it) - } - } - - ObuConstants.STATUS.UPDATE -> { - } - - // 删除 - ObuConstants.STATUS.DELETE -> { - // 关闭警告红边 - CallerHmiManager.showWarning(WarningDirectionEnum.ALERT_WARNING_NON) - // 更新数据 - TrafficDataConvertUtils.cvxPtcThreatIndInfo2TrafficData(info)?.let { - CallerObuListenerManager.removeTrackerWarningInfo(it) - // 事件结束,还原交通参与者颜色 - it.threatLevel = 0x01 - CallerMapUIServiceManager.getMarkerService() - ?.updateITrafficThreatLevelInfo(it) - } -// CallerHmiManager.disableWarningV2X(ObuConstants.USE_CASE_ID.VRUCW.toString()) - } - } - - } -// } - } - - // (5) 限速预警信息:CVX_SLW_THREAT_IND - override fun onCvxSlwThreatIndInfo(info: CvxSlwThreatIndInfo?) { - //todo 限速走高精地图 屏蔽OBU限速\ -// CallerLogger.d("$M_OBU${MogoObuConst.TAG_MOGO_OBU}", "onCvxSlwThreatIndInfo ------> $info") -// if (info != null) { -// when (info.status) { -// // 添加 -// ObuConstants.STATUS.ADD, -// ObuConstants.STATUS.UPDATE -// -> { -// if (info.ext_info != null) { -// // 计算为千米每小时 TODO 这里需要做一下向上取整数,40,60,80,120等 -// CallerLogger.d( -// "$M_OBU${MogoObuConst.TAG_MOGO_OBU}", -// "info.ext_info.speed_limit_max ------> ${info.ext_info.speed_limit_max}" -// ) -// CallerHmiManager.showLimitingVelocity((Math.round(((info.ext_info.speed_limit_max * 60 * 60) / 1000) / 10) * 10).toInt()) -// } -// } -// // 删除 -// ObuConstants.STATUS.DELETE -> { -// CallerHmiManager.disableLimitingVelocity() -// } -// } -// } - } - - - // (1) V2V预警信息:CVX_V2V_THREAT_IND - override fun onCvxV2vThreatIndInfo(info: CvxV2vThreatIndInfo?) { -// if (HmiBuildConfig.isShowObuV2vView) { - CallerLogger.d( - "$M_OBU${MogoObuConst.TAG_MOGO_OBU}", - "onCvxV2vThreatIndInfo ------> $info" - ) - info?.let { - //预警信息,预警类型 threat_level 2、3 - info.threat_info?.let { - //预警方位 - val direction = - getMessageDirection(if (info.ext_info != null) info.ext_info.target_classification else -1) - //处理预警类型 - val appId = info.threat_info.app_id - val level = info.threat_info.threat_level - val status = info.status - if (info.ext_info != null) { - CallerLogger.d( - "$M_OBU${MogoObuConst.TAG_MOGO_OBU}", - "onCvxV2vThreatIndInfo target_classification = ${ - getMessageDirection(info.ext_info.target_classification) - } --- direction = $direction --- appId = $appId ---level = $level -- status = $status" - ) - } - - handleSdkObu(appId, direction, status, level, info) - } - } - } -// } - } - - /** - * 返回OBU监听 - */ - fun getMogoObuListener(): OnMogoObuListener { - return mogoObuListener - } - - /** - * 获取消息的方位 车辆相关 - */ - private fun getMessageDirection(targetClassification: Int): WarningDirectionEnum { - CallerLogger.d("$M_OBU${MogoObuConst.TAG_MOGO_OBU}", "预警红边:预警方向->$targetClassification") - return when (targetClassification) { - ObuConstants.TARGET_CLASSIFICATION.TC_ONCOMING_IN_LANE, - ObuConstants.TARGET_CLASSIFICATION.TC_AHEAD_IN_LANE, - 0x04 -> WarningDirectionEnum.ALERT_WARNING_TOP //正前方 - - 0x03 -> WarningDirectionEnum.ALERT_WARNING_RIGHT //正右方 - - ObuConstants.TARGET_CLASSIFICATION.TC_BEHIND_IN_LANE, - 0x05 -> WarningDirectionEnum.ALERT_WARNING_BOTTOM //正后方 - - 0x02 -> WarningDirectionEnum.ALERT_WARNING_LEFT //正左方 - - ObuConstants.TARGET_CLASSIFICATION.TC_AHEAD_LEFT, - ObuConstants.TARGET_CLASSIFICATION.TC_AHEAD_FAR_LEFT, - ObuConstants.TARGET_CLASSIFICATION.TC_ONCOMING_LEFT, - ObuConstants.TARGET_CLASSIFICATION.TC_ONCOMING_FAR_LEFT, - ObuConstants.TARGET_CLASSIFICATION.TC_INTERSECTION_LEFT -> WarningDirectionEnum.ALERT_WARNING_TOP_LEFT //左前方 - - ObuConstants.TARGET_CLASSIFICATION.TC_ONCOMING_FAR_RIGHT, - ObuConstants.TARGET_CLASSIFICATION.TC_AHEAD_FAR_RIGHT, - ObuConstants.TARGET_CLASSIFICATION.TC_AHEAD_RIGHT, - ObuConstants.TARGET_CLASSIFICATION.TC_INTERSECTION_RIGHT, - ObuConstants.TARGET_CLASSIFICATION.TC_ONCOMING_RIGHT -> WarningDirectionEnum.ALERT_WARNING_TOP_RIGHT //右前方 - - ObuConstants.TARGET_CLASSIFICATION.TC_BEHIND_LEFT, - ObuConstants.TARGET_CLASSIFICATION.TC_BEHIND_FAR_LEFT -> WarningDirectionEnum.ALERT_WARNING_BOTTOM_LEFT //左后方 - - ObuConstants.TARGET_CLASSIFICATION.TC_BEHIND_RIGHT, - ObuConstants.TARGET_CLASSIFICATION.TC_BEHIND_FAR_RIGHT -> WarningDirectionEnum.ALERT_WARNING_BOTTOM_RIGHT //右后方 - - ObuConstants.TARGET_CLASSIFICATION.TC_UNCLASSIFIED -> WarningDirectionEnum.ALERT_WARNING_NON //未知 - else -> WarningDirectionEnum.ALERT_WARNING_ALL - } - } - - fun release() { - MogoObuManager.getInstance().unregisterListener() - } - - /** - * 处理红绿灯 - */ - private fun handlerTrafficLight(appId: Int, status: Int, lights: List, index: Int) { - CallerLogger.d( - "$M_OBU${MogoObuConst.TAG_MOGO_OBU}", - "handlerTrafficLight appId = $appId --- status = $status ---index = $index ---lights.size = ${lights.size} ---lights = $lights " - ) - when (status) { - // 添加 - ObuConstants.STATUS.ADD, - ObuConstants.STATUS.UPDATE - -> { - changeTrafficLightStatus(appId, lights, index) - } - // 删除 - ObuConstants.STATUS.DELETE -> { - // 移除顶部弹窗 - CallerHmiManager.disableWarningTrafficLight() -// CallerHmiManager.disableWarningV2X(appId.toString()) - } - } - } - - private var isRedLight = false - private var isGreenLight = false - - /** - * 修改红绿灯 - */ - @Synchronized - private fun changeTrafficLightStatus( - appId: Int, - lights: List, - index: Int - ) { - var ttsContent = "" - var alertContent = "" - //这里需要根据真实数据确定 index 取值方式 - if (index != -1 && lights.size >= index) { - val currentLight = lights[index] - CallerLogger.d( - "$M_OBU${MogoObuConst.TAG_MOGO_OBU}", - "currentLight = $currentLight ---currentLight.phase = ${currentLight.phase} ---rlvw_violation_type = ${currentLight.rlvw_violation_type} --- index = $index ---appId = $appId ---appId = $appId" - ) - // 闯红灯预警 - when (currentLight.rlvw_violation_type) { - 0x0 -> {//不可用 V2I_RLVW_VIOLATION_TYPE_UNAVAILABLE - } - 0x1 -> {//无违规 V2I_RLVW_VIOLATION_TYPE_NO_VIOLATION -// CallerHmiManager.disableWarningV2X(appId.toString()) - } - 0x2 -> {//闯红灯 V2I_RLVW_VIOLATION_TYPE_RUNNING_RED_LIGHT - ttsContent = EventTypeEnum.getWarningTts(appId.toString()) - alertContent = EventTypeEnum.getWarningContent(appId.toString()) - CallerLogger.d("$M_OBU${MogoObuConst.TAG_MOGO_OBU}", "old changeTrafficLightStatus ------> appId.toString() = ${appId.toString()} --- alertContent = $alertContent --- ttsContent = $ttsContent ") - if (alertContent.isNullOrEmpty() || ttsContent.isNullOrEmpty()) { - Log.d("MsgBox-PriObuManager1", "alertContent或ttsContent为空!") - } - CallerMsgBoxManager.saveMsgBox( - MsgBoxBean( - MsgBoxType.OBU, - V2XMsg(appId.toString(), alertContent, ttsContent) - ) - ) - CallerHmiManager.warningV2X( - appId.toString(), alertContent, ttsContent,// 只有第一次才tts,防止更新的时候不断的提醒 - appId.toString(), null, true, 5000L - ) - } - 0x3 -> {//闯黄灯 V2I_RLVW_VIOLATION_TYPE_RUNNING_YELLOW_LIGHT - } - } - - when (currentLight.phase) { - // 灯光不可用 - 0x0 -> { - CallerHmiManager.showWarningTrafficLight(0, 3) - } - // 红灯 - 0x1 -> { - if (!isRedLight) { -// CallerHmiManager.disableWarningV2X(appId.toString()) - isRedLight = true - } - isGreenLight = false - CallerHmiManager.showWarningTrafficLight(1, 3) - - val red = currentLight.count_down.toInt() - CallerHmiManager.changeCountdownRed(red) - CallerHmiManager.changeCountdownGreen(0) - CallerHmiManager.changeCountdownYellow(0) - - } - // 绿灯 - 0x2 -> { - if (!isGreenLight) { -// CallerHmiManager.disableWarningV2X(appId.toString()) - isGreenLight = true - } - isRedLight = false - CallerHmiManager.showWarningTrafficLight(3, 3) - val green = currentLight.count_down.toInt() - CallerHmiManager.changeCountdownGreen(green) - //防止数据出现问题的容错 - CallerHmiManager.changeCountdownRed(0) - CallerHmiManager.changeCountdownYellow(0) - // 拼接建议速度 - CallerLogger.d( - "$M_OBU${MogoObuConst.TAG_MOGO_OBU}", - "speed_min = ${currentLight.glosa_suggested_speed_min} --speed_max = ${currentLight.glosa_suggested_speed_max.toInt()}" - ) - val adviceSpeed = - "${currentLight.glosa_suggested_speed_min.toInt()} - ${currentLight.glosa_suggested_speed_max.toInt()}" - - val adviceSpeedTts = - "${currentLight.glosa_suggested_speed_min.toInt()}到${currentLight.glosa_suggested_speed_max.toInt()}" - - ttsContent = - String.format( - EventTypeEnum.getWarningTts(EventTypeEnum.TYPE_USECASE_ID_IVP_GREEN.poiType), - adviceSpeedTts - ) - - alertContent = - String.format( - EventTypeEnum.getWarningContent(EventTypeEnum.TYPE_USECASE_ID_IVP_GREEN.poiType), - adviceSpeed - ) - - val maxSpeed = currentLight.glosa_suggested_speed_max.toInt() - if (maxSpeed > 0) { - CallerLogger.d("$M_OBU${MogoObuConst.TAG_MOGO_OBU}", "old changeTrafficLightStatus ------> TYPE_USECASE_ID_IVP_GREEN --- alertContent = $alertContent --- ttsContent = $ttsContent ") - if (alertContent.isNullOrEmpty() || ttsContent.isNullOrEmpty()) { - Log.d("MsgBox-PriObuManager2", "alertContent或ttsContent为空!") - } - CallerMsgBoxManager.saveMsgBox( - MsgBoxBean( - MsgBoxType.OBU, - V2XMsg(EventTypeEnum.TYPE_USECASE_ID_IVP_GREEN.poiType, - alertContent, - ttsContent) - ) - ) - CallerHmiManager.warningV2X( - EventTypeEnum.TYPE_USECASE_ID_IVP_GREEN.poiType, - alertContent, - ttsContent,// 只有第一次才tts,防止更新的时候不断的提醒 - appId.toString(), - null, - true, - 5000L - ) - } - } - // 黄灯 - 0x3 -> { -// CallerHmiManager.disableWarningV2X(appId.toString()) - CallerHmiManager.showWarningTrafficLight(2, 2) - val yellow = currentLight.count_down.toInt() - CallerHmiManager.changeCountdownYellow(yellow) - CallerHmiManager.changeCountdownGreen(0) - CallerHmiManager.changeCountdownRed(0) - } - } - } - - } - - - //todo 二期优化此处内容,注解参数 - /** - * 构造对应展示数据和场景 根据obu的场景,add change delete确定是否展示 - * - * @param appId 使用WarningTypeEnum获取icon、提示内容、tts内容 - * - */ - private fun handleSdkObu( - appId: Int, - direction: WarningDirectionEnum, - status: Int, - level: Int, - info: CvxV2vThreatIndInfo - ) { - // 这里排除需要特殊定制的语音及文案外,其余的都可以使用 EventTypeEnum 提供的 - CallerLogger.d( - "$M_OBU${MogoObuConst.TAG_MOGO_OBU}", - "handleSdkObu appId = $appId --- handleDirection = $direction ---level = $level ---status = $status" - ) - var alertContent: String? = null - var ttsContent: String? = null - var changeVisualAngle = false - when (appId.toString()) { - // 变道预警,注意左后车辆/注意右后车辆 - EventTypeEnum.TYPE_USECASE_ID_LCW.poiType -> { - EventTypeHelper.getLCW(appId, direction) { alert, tts -> - alertContent = alert - ttsContent = tts - } - } - //车辆失控预警 - EventTypeEnum.TYPE_USECASE_ID_CLW.poiType -> { - EventTypeHelper.getCLW(appId, direction) { alert, tts -> - alertContent = alert - ttsContent = tts - } - } - //左转辅助 - EventTypeEnum.TYPE_USECASE_ID_LTA.poiType -> { - EventTypeHelper.getLTA(appId) { alert, tts -> - alertContent = alert - ttsContent = tts - } - } - //异常车辆提醒 - EventTypeEnum.TYPE_USECASE_ID_AVW.poiType -> { - EventTypeHelper.getAVW(appId, direction) { alert, tts -> - alertContent = alert - ttsContent = tts - } - } - //盲区预警 - EventTypeEnum.TYPE_USECASE_ID_BSW.poiType -> { - EventTypeHelper.getBSW(appId, direction) { alert, tts, visualAngle -> - alertContent = alert - ttsContent = tts - changeVisualAngle = visualAngle - } - } - //前车急刹预警 - EventTypeEnum.TYPE_USECASE_ID_EBW.poiType -> { - EventTypeHelper.getEBW(appId) { alert, tts -> - alertContent = alert - ttsContent = tts - } - } - //前向碰撞预警 - EventTypeEnum.TYPE_USECASE_ID_FCW.poiType -> { - EventTypeHelper.getFCW(appId) { alert, tts -> - alertContent = alert - ttsContent = tts - } - } - //逆向超车预警 - EventTypeEnum.TYPE_USECASE_ID_DNPW.poiType -> { - EventTypeHelper.getDNPW(appId) { alert, tts -> - alertContent = alert - ttsContent = tts - } - } - - // 这里处理固定的提示信息,包括了<紧急车辆提醒> - else -> { - ttsContent = EventTypeEnum.getWarningTts(appId.toString()) - alertContent = EventTypeEnum.getWarningContent(appId.toString()) - } - } - - when (status) { - // 添加,更新 add的时候,可能级别是2, - ObuConstants.STATUS.ADD, - ObuConstants.STATUS.UPDATE -> { - CallerLogger.d( - "$M_OBU${MogoObuConst.TAG_MOGO_OBU}", - "appId2 = $appId --- level = $level ---ttsContent = $ttsContent --- alertContent = $alertContent --- direction = $direction" - ) - if (level == 2 || level == 3) { - //不显示顶部弹框,其它保留 - CallerLogger.d("$M_OBU${MogoObuConst.TAG_MOGO_OBU}", - "old handleSdkObu appId2 = $appId --- level = $level ---ttsContent = $ttsContent --- alertContent = $alertContent --- direction = $direction" - ) - if (alertContent.isNullOrEmpty() || ttsContent.isNullOrEmpty()) { - Log.d("MsgBox-PriObuManager3", "alertContent或ttsContent为空!") - } - CallerMsgBoxManager.saveMsgBox( - MsgBoxBean( - MsgBoxType.OBU, - V2XMsg(appId.toString(), - alertContent, - ttsContent) - ) - ) - CallerHmiManager.warningV2X( - appId.toString(), - alertContent, - ttsContent,// 只有第一次才tts,防止更新的时候不断的提醒 - (appId + direction.direction).toString(),//使用当前事件类型+方向记录tag,当发生变化的时候关闭当前弹出新的 - object : IMoGoWarningStatusListener { - - override fun onShow() { - super.onShow() - if (changeVisualAngle) { - CallerVisualAngleManager.changeVisualAngle(TooClose) - } - } - - override fun onDismiss() { - // 关闭警告红边 - CallerHmiManager.showWarning(WarningDirectionEnum.ALERT_WARNING_NON) - if (changeVisualAngle) { - CallerVisualAngleManager.changeVisualAngle(Default()) - } - } - }, - true, - 5000L - ) - //显示警告红边 - CallerHmiManager.showWarning(direction) - } - //更新周边车辆进行预警颜色变换,车辆实时移动和变色 - TrafficDataConvertUtils.cvxV2vThreatIndInfo2TrafficData(info)?.let { - CallerObuListenerManager.invokeTrackerWarningInfo(it) - CallerMapUIServiceManager.getMarkerService()?.updateITrafficThreatLevelInfo(it) - } - } - // 删除 - ObuConstants.STATUS.DELETE -> { - // 关闭警告红边 - CallerHmiManager.showWarning(WarningDirectionEnum.ALERT_WARNING_NON) - // 移除顶部弹窗 -// CallerHmiManager.disableWarningV2X((appId + direction.direction).toString()) - //更新周边车辆进行预警颜色变换,车辆实时移动和变色 - TrafficDataConvertUtils.cvxV2vThreatIndInfo2TrafficData(info)?.let { - CallerObuListenerManager.removeTrackerWarningInfo(it) - it.threatLevel = 0x01 - CallerMapUIServiceManager.getMarkerService()?.updateITrafficThreatLevelInfo(it) - } - } - } - } - - -} \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-obu-mogo/src/main/java/com/mogo/eagle/core/function/obu/mogo/MogoPrivateObuNewManager.kt b/core/function-impl/mogo-core-function-obu-mogo/src/main/java/com/mogo/eagle/core/function/obu/mogo/MogoPrivateObuNewManager.kt index 93706d2adc..b6fcf64afc 100644 --- a/core/function-impl/mogo-core-function-obu-mogo/src/main/java/com/mogo/eagle/core/function/obu/mogo/MogoPrivateObuNewManager.kt +++ b/core/function-impl/mogo-core-function-obu-mogo/src/main/java/com/mogo/eagle/core/function/obu/mogo/MogoPrivateObuNewManager.kt @@ -88,6 +88,11 @@ class MogoPrivateObuNewManager private constructor() { return mogoObuListener } + fun disconnect() { + MogoObuManager.getInstance().disconnect() + } + + private val mogoObuListener: OnMogoObuListener = object : OnMogoObuListener() { /** * 连接状态的改变 @@ -105,13 +110,6 @@ class MogoPrivateObuNewManager private constructor() { mObuStatusInfo.obuStatus = true CallerObuListenerManager.invokeListener(mObuStatusInfo) mContext?.let { SharedPrefsMgr.getInstance(it).putBoolean("OBU", true) } - - //断开老obu - try { - com.zhidao.support.obu.MogoObuManager.getInstance().disConnect() - } catch (e: Exception) { - e.printStackTrace() - } } } diff --git a/core/function-impl/mogo-core-function-obu-mogo/src/main/java/com/mogo/eagle/core/function/obu/mogo/utils/TrafficDataConvertUtils.kt b/core/function-impl/mogo-core-function-obu-mogo/src/main/java/com/mogo/eagle/core/function/obu/mogo/utils/TrafficDataConvertUtils.kt deleted file mode 100644 index 8e94bc8bc6..0000000000 --- a/core/function-impl/mogo-core-function-obu-mogo/src/main/java/com/mogo/eagle/core/function/obu/mogo/utils/TrafficDataConvertUtils.kt +++ /dev/null @@ -1,133 +0,0 @@ -package com.mogo.eagle.core.function.obu.mogo.utils - -import com.mogo.eagle.core.data.traffic.TrafficData -import com.mogo.eagle.core.data.enums.TrafficTypeEnum -import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger -import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_OBU -import com.zhidao.support.obu.constants.ObuConstants -import com.zhidao.support.obu.model.CvxPtcThreatIndInfo -import com.zhidao.support.obu.model.CvxRtiThreatIndInfo -import com.zhidao.support.obu.model.CvxRvInfoIndInfo -import com.zhidao.support.obu.model.CvxV2vThreatIndInfo - -/** - * @author xiaoyuzhou - * @date 2021/8/18 2:30 下午 - */ -object TrafficDataConvertUtils { - val TAG = "TrafficDataConvertUtils" - - /** - * OBU 远车 转换交通元素数据 - */ - fun cvxRvInfoIndInfo2TrafficData(info: CvxRvInfoIndInfo): TrafficData? { - if (info.basic_info == null || info.basic_info.position == null) { - CallerLogger.e("$M_OBU$TAG", "cvxRvInfoIndInfo2TrafficData 数据转换异常,请检查参数是否齐全") - return null - } - val trafficData = TrafficData() - trafficData.type = TrafficTypeEnum.TYPE_TRAFFIC_ID_TA_CHE - trafficData.uuid = info.vehicle_id - trafficData.lat = info.basic_info.position.latitude - trafficData.lon = info.basic_info.position.longitude - trafficData.heading = info.basic_info.heading - trafficData.speed = info.basic_info.speed - - return trafficData - } - - /** - * OBU RSU道路事件预警信息 转换交通元素数据 - */ - fun cvxRtiThreatIndInfo2TrafficData(info: CvxRtiThreatIndInfo): TrafficData? { - // 这里只处理道路施工 - if(info.ext_info.rti_type != 0x7){ - return null - } - if (info.rti_id == null || info.ext_info == null - || info.zones_info == null || info.zones_info.first() == null - || info.zones_info.first().path_points.first() == null - || info.threat_info == null - ) { - CallerLogger.e("$M_OBU$TAG", "数据转换异常,请检查参数是否齐全") - return null - } - val trafficData = TrafficData() - trafficData.type = TrafficTypeEnum.TYPE_TRAFFIC_ID_DAO_LU_SHI_GONG - trafficData.uuid = info.rti_id - - trafficData.lat = info.zones_info.first().path_points.first().latitude - trafficData.lon = info.zones_info.first().path_points.first().longitude - - trafficData.threatLevel = info.threat_info.threat_level - - return trafficData - } - - /** - * OBU 预警事件 转换交通元素数据 - */ - fun cvxV2vThreatIndInfo2TrafficData(info: CvxV2vThreatIndInfo): TrafficData? { - if (info.basic_info == null || info.basic_info.position == null || info.threat_info == null) { - CallerLogger.e("$M_OBU$TAG", "数据转换异常,请检查参数是否齐全") - return null - } - val trafficData = TrafficData() - trafficData.uuid = info.vehicle_id - trafficData.lat = info.basic_info.position.latitude - trafficData.lon = info.basic_info.position.longitude - trafficData.heading = info.basic_info.heading - trafficData.speed = info.basic_info.speed - // 判断车辆V2X预警级别,调整车辆颜色 - trafficData.threatLevel = info.threat_info.threat_level - - if (info.threat_info.app_id == ObuConstants.USE_CASE_ID.EVW) { - trafficData.type = TrafficTypeEnum.TYPE_TRAFFIC_ID_SPECIAL_VEHICLE - } else { - trafficData.type = TrafficTypeEnum.TYPE_TRAFFIC_ID_TA_CHE - } - - return trafficData - } - - /** - * OBU 弱势交通参与者信息 转换交通元素数据 TODO - */ - fun cvxPtcThreatIndInfo2TrafficData(info: CvxPtcThreatIndInfo): TrafficData? { - if (info.ptc_pos == null || info.threat_info == null) { - CallerLogger.e("$M_OBU$TAG", "数据转换异常,请检查参数是否齐全") - return null - } - val trafficData = TrafficData() - - trafficData.uuid = info.ptc_id - trafficData.lat = info.ptc_pos.latitude - trafficData.lon = info.ptc_pos.longitude -// trafficData.heading = info.ptc_pos.heading -// trafficData.speed = info.ptc_pos.speed - - when (info.ptc_type) { - // 未知 - 0x0 -> { - trafficData.type = TrafficTypeEnum.TYPE_TRAFFIC_ID_WEI_ZHI - } - // 非机动车 - 0x1 -> { - trafficData.type = TrafficTypeEnum.TYPE_TRAFFIC_ID_MOTO - } - // 行人 - 0x2 -> { - trafficData.type = TrafficTypeEnum.TYPE_TRAFFIC_ID_PEOPLE - } - } - - // 判断车辆V2X预警级别,调整车辆颜色 - if (info.threat_info != null) { - trafficData.threatLevel = info.threat_info.threat_level - } - - return trafficData - } - - -} \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/alarm/V2XAlarmServer.java b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/alarm/V2XAlarmServer.java index 0c09db8c20..c4f2ca6de0 100644 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/alarm/V2XAlarmServer.java +++ b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/alarm/V2XAlarmServer.java @@ -1,15 +1,17 @@ package com.mogo.eagle.core.function.v2x.events.alarm; +import android.util.Log; + +import com.mogo.eagle.core.data.enums.EventTypeEnumNew; import com.mogo.eagle.core.data.map.MogoLocation; import com.mogo.eagle.core.data.map.entity.MarkerLocation; import com.mogo.eagle.core.data.map.entity.V2XRoadEventEntity; -import com.mogo.eagle.core.data.enums.EventTypeEnum; import com.mogo.eagle.core.utilcode.util.DrivingDirectionUtils; import java.util.Iterator; import java.util.concurrent.CopyOnWriteArrayList; + import io.netty.util.internal.ConcurrentSet; -import android.util.Log; /** * @author donghongyu @@ -64,7 +66,7 @@ public class V2XAlarmServer { double distance = v2XRoadEventEntity.getDistance(); Log.d("RWJ", "distance:" + distance); if (distance <= 500) { - if (EventTypeEnum.GHOST_PROBE.getPoiType().equals(v2XRoadEventEntity.getPoiType())) { + if (EventTypeEnumNew.GHOST_PROBE.getPoiType().equals(v2XRoadEventEntity.getPoiType())) { if (distance > 25) { continue; } diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/manager/impl/MoGoV2XMarkerManager.java b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/manager/impl/MoGoV2XMarkerManager.java index 13432dbf4f..ffa58677e6 100644 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/manager/impl/MoGoV2XMarkerManager.java +++ b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/manager/impl/MoGoV2XMarkerManager.java @@ -10,6 +10,7 @@ import com.alibaba.android.arouter.facade.annotation.Route; import com.mogo.cloud.commons.utils.CoordinateUtils; import com.mogo.commons.AbsMogoApplication; import com.mogo.commons.module.status.MogoStatusManager; +import com.mogo.eagle.core.data.enums.EventTypeEnumNew; import com.mogo.eagle.core.data.map.MogoLatLng; import com.mogo.eagle.core.data.map.MogoLocation; import com.mogo.eagle.core.data.map.entity.MarkerExploreWay; @@ -26,16 +27,15 @@ import com.mogo.eagle.core.function.v2x.events.manager.V2XStatusManager; import com.mogo.eagle.core.function.v2x.events.marker.V2XMarkerAdapter; import com.mogo.eagle.core.function.v2x.events.utils.EntityUtilsKt; import com.mogo.eagle.core.function.v2x.events.utils.MapUtils; +import com.mogo.eagle.core.function.v2x.internal.V2XManager; +import com.mogo.eagle.core.function.v2x.internal.data.V2XMarkerCardResult; +import com.mogo.eagle.core.function.v2x.internal.data.V2XMarkerExploreWay; +import com.mogo.eagle.core.function.v2x.internal.data.V2XMarkerLocation; import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger; import com.mogo.map.marker.IMogoMarker; import com.mogo.map.marker.IMogoMarkerClickListener; import com.mogo.map.marker.IMogoMarkerManager; import com.mogo.map.marker.MogoMarkerOptions; -import com.mogo.eagle.core.data.enums.EventTypeEnum; -import com.mogo.eagle.core.function.v2x.internal.V2XManager; -import com.mogo.eagle.core.function.v2x.internal.data.V2XMarkerCardResult; -import com.mogo.eagle.core.function.v2x.internal.data.V2XMarkerExploreWay; -import com.mogo.eagle.core.function.v2x.internal.data.V2XMarkerLocation; import java.util.List; import java.util.Objects; @@ -110,7 +110,7 @@ public class MoGoV2XMarkerManager implements IMoGoV2XMarkerManager { List exploreWayList = markerCardResult.getExploreWay(); if (exploreWayList != null) { for (V2XMarkerExploreWay markerExploreWay : exploreWayList) { - if (EventTypeEnum.isRoadEvent(markerExploreWay.getPoiType())) { + if (EventTypeEnumNew.isRoadEvent(markerExploreWay.getPoiType())) { V2XMarkerLocation markerLocation = markerExploreWay.getLocation(); // 记录道路事件 V2XRoadEventEntity v2XRoadEventEntity = new V2XRoadEventEntity(); diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/marker/V2XMarkerAdapter.java b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/marker/V2XMarkerAdapter.java index f612b4e6b5..eb6107c2db 100644 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/marker/V2XMarkerAdapter.java +++ b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/marker/V2XMarkerAdapter.java @@ -3,9 +3,9 @@ package com.mogo.eagle.core.function.v2x.events.marker; import android.content.Context; import android.graphics.Bitmap; +import com.mogo.eagle.core.data.enums.EventTypeEnumNew; import com.mogo.eagle.core.data.map.entity.V2XRoadEventEntity; import com.mogo.eagle.core.function.v2x.R; -import com.mogo.eagle.core.data.enums.EventTypeEnum; import com.mogo.eagle.core.function.v2x.events.view.V2XMarkerRoadEventView; import java.util.ArrayList; @@ -31,10 +31,10 @@ public class V2XMarkerAdapter { */ public static Bitmap getV2XRoadEventViewPng(Context context, V2XRoadEventEntity alarmInfo) { Bitmap bitmap; - if (EventTypeEnum.ALERT_TRAFFIC_LIGHT_SUGGEST.getPoiType().equals(alarmInfo.getPoiType()) - || EventTypeEnum.ALERT_TRAFFIC_LIGHT_WARNING.getPoiType().equals(alarmInfo.getPoiType()) - || EventTypeEnum.FOURS_BLOCK_UP.getPoiType().equals(alarmInfo.getPoiType()) - || EventTypeEnum.ALERT_CAR_TROUBLE_WARNING.getPoiType().equals(alarmInfo.getPoiType())) { + if (EventTypeEnumNew.ALERT_TRAFFIC_LIGHT_SUGGEST.getPoiType().equals(alarmInfo.getPoiType()) + || EventTypeEnumNew.ALERT_TRAFFIC_LIGHT_WARNING.getPoiType().equals(alarmInfo.getPoiType()) + || EventTypeEnumNew.FOURS_BLOCK_UP.getPoiType().equals(alarmInfo.getPoiType()) + || EventTypeEnumNew.ALERT_CAR_TROUBLE_WARNING.getPoiType().equals(alarmInfo.getPoiType())) { bitmap = getV2XRoadEventMarkerView( context, alarmInfo, @@ -53,10 +53,10 @@ public class V2XMarkerAdapter { */ public static ArrayList getV2XRoadEventViewGif(Context context, V2XRoadEventEntity alarmInfo) { ArrayList bitmapArrayList; - if (EventTypeEnum.ALERT_TRAFFIC_LIGHT_SUGGEST.getPoiType().equals(alarmInfo.getPoiType()) - || EventTypeEnum.ALERT_TRAFFIC_LIGHT_WARNING.getPoiType().equals(alarmInfo.getPoiType()) - || EventTypeEnum.FOURS_BLOCK_UP.getPoiType().equals(alarmInfo.getPoiType()) - || EventTypeEnum.ALERT_CAR_TROUBLE_WARNING.getPoiType().equals(alarmInfo.getPoiType())) { + if (EventTypeEnumNew.ALERT_TRAFFIC_LIGHT_SUGGEST.getPoiType().equals(alarmInfo.getPoiType()) + || EventTypeEnumNew.ALERT_TRAFFIC_LIGHT_WARNING.getPoiType().equals(alarmInfo.getPoiType()) + || EventTypeEnumNew.FOURS_BLOCK_UP.getPoiType().equals(alarmInfo.getPoiType()) + || EventTypeEnumNew.ALERT_CAR_TROUBLE_WARNING.getPoiType().equals(alarmInfo.getPoiType())) { bitmapArrayList = getV2XRoadEventOrangeMarkerView(context, alarmInfo); } else { bitmapArrayList = getV2XRoadEventRedMarkerView(context, alarmInfo); diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/view/V2XMarkerRoadEventView.kt b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/view/V2XMarkerRoadEventView.kt index 1b3e41053c..c9d1589194 100644 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/view/V2XMarkerRoadEventView.kt +++ b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/view/V2XMarkerRoadEventView.kt @@ -5,10 +5,10 @@ import android.content.Context import android.graphics.Bitmap import android.view.LayoutInflater import androidx.constraintlayout.widget.ConstraintLayout +import com.mogo.eagle.core.data.enums.EventTypeEnumNew import com.mogo.eagle.core.data.map.entity.V2XRoadEventEntity import com.mogo.eagle.core.function.v2x.R import com.mogo.eagle.core.utilcode.util.ViewUtils -import com.mogo.eagle.core.data.enums.EventTypeEnum import kotlinx.android.synthetic.main.view_marker_event_car.view.* /** @@ -33,8 +33,8 @@ class V2XMarkerRoadEventView(context: Context, alarmInfo: V2XRoadEventEntity) : } fun initView(context: Context, alarmInfo: V2XRoadEventEntity) { - if (alarmInfo.poiType == EventTypeEnum.ALERT_FRONT_CAR.poiType || - alarmInfo.poiType == EventTypeEnum.ALERT_CAR_TROUBLE_WARNING.poiType + if (alarmInfo.poiType == EventTypeEnumNew.ALERT_FRONT_CAR.poiType || + alarmInfo.poiType == EventTypeEnumNew.ALERT_CAR_TROUBLE_WARNING.poiType ) { LayoutInflater.from(context) .inflate(R.layout.view_marker_event_car, this) @@ -46,11 +46,11 @@ class V2XMarkerRoadEventView(context: Context, alarmInfo: V2XRoadEventEntity) : } /** - * @see EventTypeEnum + * @see EventTypeEnumNew */ private fun updateIcon(alarmInfo: V2XRoadEventEntity) { // 道路施工、积水、路面结冰、浓雾、事故、拥堵 - val iconResId = EventTypeEnum.getUpdateIconRes(alarmInfo.poiType) + val iconResId = EventTypeEnumNew.getUpdateIconRes(alarmInfo.poiType) if (iconResId != 0) { ivCar.setImageResource(iconResId) } diff --git a/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/config/CloudPoiManager.java b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/config/CloudPoiManager.java index 7bb1b06c72..1359dd3e6b 100644 --- a/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/config/CloudPoiManager.java +++ b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/config/CloudPoiManager.java @@ -6,7 +6,6 @@ import android.util.ArrayMap; import com.elegant.network.utils.GsonUtil; import com.mogo.eagle.core.data.R; -import com.mogo.eagle.core.data.enums.EventTypeEnum; import com.mogo.eagle.core.data.enums.EventTypeEnumNew; import com.mogo.eagle.core.data.map.PoiWrapper; import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger; @@ -39,37 +38,37 @@ public class CloudPoiManager { public void generateDefault() { if (poiWrapper.isEmpty()) { - poiWrapper.put(EventTypeEnum.TRAFFIC_CHECK.getPoiType(), new PoiWrapper(EventTypeEnum.TRAFFIC_CHECK.getPoiType(), + poiWrapper.put(EventTypeEnumNew.TRAFFIC_CHECK.getPoiType(), new PoiWrapper(EventTypeEnumNew.TRAFFIC_CHECK.getPoiType(), R.drawable.module_common_icon_map_marker_road_check2, R.drawable.module_common_icon_map_marker_road_check2_white, "交通检查")); - poiWrapper.put(EventTypeEnum.ROAD_CLOSED.getPoiType(), new PoiWrapper(EventTypeEnum.ROAD_CLOSED.getPoiType(), + poiWrapper.put(EventTypeEnumNew.ROAD_CLOSED.getPoiType(), new PoiWrapper(EventTypeEnumNew.ROAD_CLOSED.getPoiType(), R.drawable.module_common_icon_map_marker_road_block_off2, R.drawable.module_common_icon_map_marker_road_block_off2_white, "封路")); - poiWrapper.put(EventTypeEnum.FOURS_ROAD_WORK.getPoiType(), new PoiWrapper(EventTypeEnum.FOURS_ROAD_WORK.getPoiType(), + poiWrapper.put(EventTypeEnumNew.FOURS_ROAD_WORK.getPoiType(), new PoiWrapper(EventTypeEnumNew.FOURS_ROAD_WORK.getPoiType(), R.drawable.module_common_icon_map_marker_road_work2, R.drawable.module_common_icon_map_marker_road_work2_white, "施工")); poiWrapper.put(EventTypeEnumNew.TYPE_SOCKET_ROAD_SHIGONG.getPoiType(), new PoiWrapper(EventTypeEnumNew.TYPE_SOCKET_ROAD_SHIGONG.getPoiType(), R.drawable.module_common_icon_map_marker_road_work2, R.drawable.module_common_icon_map_marker_road_work2_white, "施工")); - poiWrapper.put(EventTypeEnum.FOURS_BLOCK_UP.getPoiType(), new PoiWrapper(EventTypeEnum.FOURS_BLOCK_UP.getPoiType(), + poiWrapper.put(EventTypeEnumNew.FOURS_BLOCK_UP.getPoiType(), new PoiWrapper(EventTypeEnumNew.FOURS_BLOCK_UP.getPoiType(), R.drawable.module_common_icon_map_marker_road_block_up2, R.drawable.module_common_icon_map_marker_road_block_up2_white, "拥堵")); - poiWrapper.put(EventTypeEnum.FOURS_PONDING.getPoiType(), new PoiWrapper(EventTypeEnum.FOURS_PONDING.getPoiType(), + poiWrapper.put(EventTypeEnumNew.FOURS_PONDING.getPoiType(), new PoiWrapper(EventTypeEnumNew.FOURS_PONDING.getPoiType(), R.drawable.module_common_icon_map_marker_pondingl2, R.drawable.module_common_icon_map_marker_pondingl2_white, "积水")); - poiWrapper.put(EventTypeEnum.FOURS_FOG.getPoiType(), new PoiWrapper(EventTypeEnum.FOURS_FOG.getPoiType(), + poiWrapper.put(EventTypeEnumNew.FOURS_FOG.getPoiType(), new PoiWrapper(EventTypeEnumNew.FOURS_FOG.getPoiType(), R.drawable.module_common_ic_rc_dark_frog2, R.drawable.module_common_ic_rc_dark_frog2_white, "浓雾")); - poiWrapper.put(EventTypeEnum.FOURS_ICE.getPoiType(), new PoiWrapper(EventTypeEnum.FOURS_ICE.getPoiType(), + poiWrapper.put(EventTypeEnumNew.FOURS_ICE.getPoiType(), new PoiWrapper(EventTypeEnumNew.FOURS_ICE.getPoiType(), R.drawable.module_common_ic_rc_freeze2, R.drawable.module_common_ic_rc_freeze2_white, "结冰")); - poiWrapper.put(EventTypeEnum.FOURS_ACCIDENT.getPoiType(), new PoiWrapper(EventTypeEnum.FOURS_ACCIDENT.getPoiType(), + poiWrapper.put(EventTypeEnumNew.FOURS_ACCIDENT.getPoiType(), new PoiWrapper(EventTypeEnumNew.FOURS_ACCIDENT.getPoiType(), R.drawable.module_common_ic_rc_accident3, R.drawable.module_common_ic_rc_accident3_white, "事故")); - poiWrapper.put(EventTypeEnum.FOURS_ACCIDENT_01.getPoiType(), new PoiWrapper(EventTypeEnum.FOURS_ACCIDENT_01.getPoiType(), + poiWrapper.put(EventTypeEnumNew.FOURS_ACCIDENT_01.getPoiType(), new PoiWrapper(EventTypeEnumNew.FOURS_ACCIDENT_01.getPoiType(), R.drawable.module_common_ic_rc_accident3, R.drawable.module_common_ic_rc_accident3_white, "重大事故")); - poiWrapper.put(EventTypeEnum.FOURS_ACCIDENT_02.getPoiType(), new PoiWrapper(EventTypeEnum.FOURS_ACCIDENT_02.getPoiType(), + poiWrapper.put(EventTypeEnumNew.FOURS_ACCIDENT_02.getPoiType(), new PoiWrapper(EventTypeEnumNew.FOURS_ACCIDENT_02.getPoiType(), R.drawable.module_common_ic_rc_accident3, R.drawable.module_common_ic_rc_accident3_white, "特大事故")); - poiWrapper.put(EventTypeEnum.FOURS_ACCIDENT_03.getPoiType(), new PoiWrapper(EventTypeEnum.FOURS_ACCIDENT_03.getPoiType(), + poiWrapper.put(EventTypeEnumNew.FOURS_ACCIDENT_03.getPoiType(), new PoiWrapper(EventTypeEnumNew.FOURS_ACCIDENT_03.getPoiType(), R.drawable.module_common_ic_rc_accident3, R.drawable.module_common_ic_rc_accident3_white, "较大事故")); - poiWrapper.put(EventTypeEnum.FOURS_ACCIDENT_04.getPoiType(), new PoiWrapper(EventTypeEnum.FOURS_ACCIDENT_04.getPoiType(), + poiWrapper.put(EventTypeEnumNew.FOURS_ACCIDENT_04.getPoiType(), new PoiWrapper(EventTypeEnumNew.FOURS_ACCIDENT_04.getPoiType(), R.drawable.module_common_ic_rc_accident3, R.drawable.module_common_ic_rc_accident3_white, "一般事故")); - poiWrapper.put(EventTypeEnum.FOURS_ACCIDENT_05.getPoiType(), new PoiWrapper(EventTypeEnum.FOURS_ACCIDENT_05.getPoiType(), + poiWrapper.put(EventTypeEnumNew.FOURS_ACCIDENT_05.getPoiType(), new PoiWrapper(EventTypeEnumNew.FOURS_ACCIDENT_05.getPoiType(), R.drawable.module_common_ic_rc_accident3, R.drawable.module_common_ic_rc_accident3_white, "轻微事故")); - poiWrapper.put(EventTypeEnum.FOURS_LIVING.getPoiType(), new PoiWrapper(EventTypeEnum.FOURS_LIVING.getPoiType(), + poiWrapper.put(EventTypeEnumNew.FOURS_LIVING.getPoiType(), new PoiWrapper(EventTypeEnumNew.FOURS_LIVING.getPoiType(), R.drawable.module_common_icon_map_marker_living, R.drawable.module_common_icon_map_marker_living_white, "实时路况")); - poiWrapper.put(EventTypeEnum.ILLEGAL_PARK_LIVING.getPoiType(), new PoiWrapper(EventTypeEnum.ILLEGAL_PARK_LIVING.getPoiType(), + poiWrapper.put(EventTypeEnumNew.ILLEGAL_PARK_LIVING.getPoiType(), new PoiWrapper(EventTypeEnumNew.ILLEGAL_PARK_LIVING.getPoiType(), R.drawable.module_common_ic_rc_illegal_park, R.drawable.module_common_ic_rc_illegal_park_white, "违章停车")); // 分享里用到的故障求助 poiWrapper.put("9999", new PoiWrapper("9999", diff --git a/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/enums/EventTypeEnumNew.kt b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/enums/EventTypeEnumNew.kt index 977ff69174..3579d55ea4 100644 --- a/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/enums/EventTypeEnumNew.kt +++ b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/enums/EventTypeEnumNew.kt @@ -554,6 +554,22 @@ enum class EventTypeEnumNew( } } + @JvmStatic + fun getTtsWithFeedback(poiType: String?): String { + return when (poiType) { + TRAFFIC_CHECK.poiType -> "交通检查" + ROAD_CLOSED.poiType -> "封路" + FOURS_ROAD_WORK.poiType -> "施工" + FOURS_BLOCK_UP.poiType -> "道路拥堵" + FOURS_PONDING.poiType -> "道路积水" + FOURS_FOG.poiType -> "出现浓雾" + FOURS_ICE.poiType -> "路面结冰" + FOURS_ACCIDENT.poiType, FOURS_ACCIDENT_01.poiType, FOURS_ACCIDENT_02.poiType, + FOURS_ACCIDENT_03.poiType, FOURS_ACCIDENT_04.poiType, FOURS_ACCIDENT_05.poiType -> "交通事故" + else -> "道路事件" + } + } + @JvmStatic fun getPoiTypeSrcVr(poiType: String): Int { return when (poiType) { diff --git a/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/enums/EventTypeHelper.kt b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/enums/EventTypeHelper.kt index 8f8cd1ff35..b1da3cc519 100644 --- a/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/enums/EventTypeHelper.kt +++ b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/enums/EventTypeHelper.kt @@ -29,20 +29,20 @@ class EventTypeHelper { when { direction.isLeft() -> { data.invoke( - EventTypeEnum.getWarningContent(appId.toString() + "左"), - EventTypeEnum.getWarningTts(appId.toString() + "左") + EventTypeEnumNew.getWarningContent(appId.toString() + "左"), + EventTypeEnumNew.getWarningTts(appId.toString() + "左") ) } direction.isRight() -> { data.invoke( - EventTypeEnum.getWarningContent(appId.toString() + "右"), - EventTypeEnum.getWarningTts(appId.toString() + "右") + EventTypeEnumNew.getWarningContent(appId.toString() + "右"), + EventTypeEnumNew.getWarningTts(appId.toString() + "右") ) } else -> { data.invoke( - EventTypeEnum.getWarningContent(appId.toString()), - EventTypeEnum.getWarningTts(appId.toString()) + EventTypeEnumNew.getWarningContent(appId.toString()), + EventTypeEnumNew.getWarningTts(appId.toString()) ) } } @@ -56,8 +56,8 @@ class EventTypeHelper { data: ((alert: String, tts: String) -> Unit) ) { data.invoke( - EventTypeEnum.getWarningContent(appId.toString() + direction.desc), - EventTypeEnum.getWarningContent(appId.toString() + direction.desc) + EventTypeEnumNew.getWarningContent(appId.toString() + direction.desc), + EventTypeEnumNew.getWarningContent(appId.toString() + direction.desc) ) } @@ -65,8 +65,8 @@ class EventTypeHelper { @BizConfig(V2V, "", BIZ_LTA) fun getLTA(appId: Int, data: ((alert: String, tts: String) -> Unit)) { data.invoke( - EventTypeEnum.getWarningContent(appId.toString()), - EventTypeEnum.getWarningTts(appId.toString()) + EventTypeEnumNew.getWarningContent(appId.toString()), + EventTypeEnumNew.getWarningTts(appId.toString()) ) } @@ -78,8 +78,8 @@ class EventTypeHelper { data: ((alert: String, tts: String) -> Unit) ) { data.invoke( - EventTypeEnum.getWarningContent(appId.toString() + direction.desc), - EventTypeEnum.getWarningTts(appId.toString() + direction.desc) + EventTypeEnumNew.getWarningContent(appId.toString() + direction.desc), + EventTypeEnumNew.getWarningTts(appId.toString() + direction.desc) ) } @@ -93,22 +93,22 @@ class EventTypeHelper { when { direction.isLeft() -> { data.invoke( - EventTypeEnum.getWarningContent(appId.toString() + "左"), - EventTypeEnum.getWarningTts(appId.toString() + "左"), + EventTypeEnumNew.getWarningContent(appId.toString() + "左"), + EventTypeEnumNew.getWarningTts(appId.toString() + "左"), true ) } direction.isRight() -> { data.invoke( - EventTypeEnum.getWarningContent(appId.toString() + "右"), - EventTypeEnum.getWarningTts(appId.toString() + "右"), + EventTypeEnumNew.getWarningContent(appId.toString() + "右"), + EventTypeEnumNew.getWarningTts(appId.toString() + "右"), true ) } else -> { data.invoke( - EventTypeEnum.getWarningContent(appId.toString()), - EventTypeEnum.getWarningTts(appId.toString()), + EventTypeEnumNew.getWarningContent(appId.toString()), + EventTypeEnumNew.getWarningTts(appId.toString()), false ) } @@ -119,9 +119,9 @@ class EventTypeHelper { @BizConfig(V2N, "", BIZ_VRU) fun getVRU(data: ((appId: Int, tts: String, content: String) -> Unit)) { data.invoke( - EventTypeEnum.TYPE_USECASE_ID_VRUCW_PERSON.poiType.toInt(), - EventTypeEnum.TYPE_USECASE_ID_VRUCW_PERSON.tts, - EventTypeEnum.TYPE_USECASE_ID_VRUCW_PERSON.content + EventTypeEnumNew.TYPE_USECASE_ID_VRUCW_PERSON.poiType.toInt(), + EventTypeEnumNew.TYPE_USECASE_ID_VRUCW_PERSON.tts, + EventTypeEnumNew.TYPE_USECASE_ID_VRUCW_PERSON.content ) } @@ -129,7 +129,7 @@ class EventTypeHelper { @BizConfig(V2N, "", BIZ_VRU_RI) fun getVRURI(data: ((appId: Int, tts: String, content: String) -> Unit)) { data.invoke( - EventTypeEnum.TYPE_USECASE_ID_VRUCW_PERSON.poiType.toInt(), + EventTypeEnumNew.TYPE_USECASE_ID_VRUCW_PERSON.poiType.toInt(), "行人逆行预警", "行人逆行预警" ) @@ -139,18 +139,18 @@ class EventTypeHelper { @BizConfig(V2N, "", BIZ_OPT_LINE) fun getOptLine(data: ((appId: Int, tts: String, content: String) -> Unit)) { data.invoke( - EventTypeEnum.TYPE_USECASE_OPTIMAL_LANE.poiType.toInt(), - EventTypeEnum.TYPE_USECASE_OPTIMAL_LANE.tts, - EventTypeEnum.TYPE_USECASE_OPTIMAL_LANE.content + EventTypeEnumNew.TYPE_USECASE_OPTIMAL_LANE.poiType.toInt(), + EventTypeEnumNew.TYPE_USECASE_OPTIMAL_LANE.tts, + EventTypeEnumNew.TYPE_USECASE_OPTIMAL_LANE.content ) } //前方道路拥堵预警 fun getTJW(data: ((appId: Int, tts: String, content: String) -> Unit)) { data.invoke( - EventTypeEnum.FOURS_BLOCK_UP.poiType.toInt(), - EventTypeEnum.FOURS_BLOCK_UP.tts, - EventTypeEnum.FOURS_BLOCK_UP.content + EventTypeEnumNew.FOURS_BLOCK_UP.poiType.toInt(), + EventTypeEnumNew.FOURS_BLOCK_UP.tts, + EventTypeEnumNew.FOURS_BLOCK_UP.content ) } @@ -158,8 +158,8 @@ class EventTypeHelper { @BizConfig(V2V, "", BIZ_EBW) fun getEBW(appId: Int, data: ((tts: String, content: String) -> Unit)) { data.invoke( - EventTypeEnum.getWarningContent(appId.toString()), - EventTypeEnum.getWarningTts(appId.toString()) + EventTypeEnumNew.getWarningContent(appId.toString()), + EventTypeEnumNew.getWarningTts(appId.toString()) ) } @@ -167,8 +167,8 @@ class EventTypeHelper { @BizConfig(V2V, "", BIZ_FCW) fun getFCW(appId: Int, data: ((tts: String, content: String) -> Unit)) { data.invoke( - EventTypeEnum.getWarningContent(appId.toString()), - EventTypeEnum.getWarningTts(appId.toString()) + EventTypeEnumNew.getWarningContent(appId.toString()), + EventTypeEnumNew.getWarningTts(appId.toString()) ) } @@ -176,8 +176,8 @@ class EventTypeHelper { @BizConfig(V2V, "", BIZ_DNPW) fun getDNPW(appId: Int, data: ((tts: String, content: String) -> Unit)) { data.invoke( - EventTypeEnum.getWarningContent(appId.toString()), - EventTypeEnum.getWarningTts(appId.toString()) + EventTypeEnumNew.getWarningContent(appId.toString()), + EventTypeEnumNew.getWarningTts(appId.toString()) ) } diff --git a/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/map/entity/V2XRoadEventEntity.java b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/map/entity/V2XRoadEventEntity.java index 0bd2dab8fd..2c2b3a4e5a 100644 --- a/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/map/entity/V2XRoadEventEntity.java +++ b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/map/entity/V2XRoadEventEntity.java @@ -1,9 +1,6 @@ package com.mogo.eagle.core.data.map.entity; import android.text.TextUtils; - - -import com.mogo.eagle.core.data.enums.EventTypeEnum; import com.mogo.eagle.core.data.enums.EventTypeEnumNew; import java.io.Serializable; @@ -59,12 +56,12 @@ public class V2XRoadEventEntity implements Serializable { } public String getTts(boolean haveLiveCar) { - if (EventTypeEnum.GHOST_PROBE.getPoiType().equals(poiType)) { - tts = EventTypeEnum.GHOST_PROBE.getTts(); + if (EventTypeEnumNew.GHOST_PROBE.getPoiType().equals(poiType)) { + tts = EventTypeEnumNew.GHOST_PROBE.getTts(); return tts; } tts = "前方#" + (int) getDistance() + "米#"; - tts += EventTypeEnum.getTts(getPoiType()); + tts += EventTypeEnumNew.getTts(getPoiType()); if (haveLiveCar) { tts += ",查看实况请说确定。"; setShowEventButton(true); @@ -80,7 +77,7 @@ public class V2XRoadEventEntity implements Serializable { */ public String getTtsWithFeedback() { tts = "检测到附近"; - tts += EventTypeEnum.getTtsWithFeedback(getPoiType()); + tts += EventTypeEnumNew.getTtsWithFeedback(getPoiType()); tts += ",确认该信息是否正确?您可以说“正确”或“错误”帮助其他车友。"; return tts; } @@ -102,7 +99,7 @@ public class V2XRoadEventEntity implements Serializable { } public String getAlarmContent() { - alarmContent = EventTypeEnum.getAlarmContent(getPoiType()); + alarmContent = EventTypeEnumNew.getAlarmContent(getPoiType()); return alarmContent; } From 0b84b3855e1df67827362f89039af5db2d8555f7 Mon Sep 17 00:00:00 2001 From: lixiaopeng Date: Mon, 30 Jan 2023 18:13:25 +0800 Subject: [PATCH 06/18] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=96=B0=E7=9A=84obu?= =?UTF-8?q?=20sdk=E6=97=A5=E5=BF=97=E7=9A=84=E5=BC=80=E5=85=B3=E5=8A=9F?= =?UTF-8?q?=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mogo-core-function-hmi/build.gradle | 1 + .../hmi/ui/setting/DebugSettingView.kt | 20 ++++++++++++++----- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/core/function-impl/mogo-core-function-hmi/build.gradle b/core/function-impl/mogo-core-function-hmi/build.gradle index 86fe27008a..cfbb042e0e 100644 --- a/core/function-impl/mogo-core-function-hmi/build.gradle +++ b/core/function-impl/mogo-core-function-hmi/build.gradle @@ -69,6 +69,7 @@ dependencies { // debugImplementation rootProject.ext.dependencies.debugleakcanary // releaseImplementation rootProject.ext.dependencies.releaseleakcanary + implementation rootProject.ext.dependencies.mogoobu implementation rootProject.ext.dependencies.arouter kapt rootProject.ext.dependencies.aroutercompiler diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/DebugSettingView.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/DebugSettingView.kt index 6911df61f8..1674acdcb5 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/DebugSettingView.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/DebugSettingView.kt @@ -16,6 +16,7 @@ import androidx.appcompat.widget.PopupMenu import androidx.constraintlayout.widget.ConstraintLayout import androidx.core.content.ContextCompat import androidx.core.view.* +import androidx.lifecycle.lifecycleScope import chassis.Chassis import chassis.ChassisStatesOuterClass import com.mogo.cloud.passport.MoGoAiCloudClient @@ -63,6 +64,7 @@ import com.mogo.eagle.core.function.hmi.ui.logcatch.ILogViewListener import com.mogo.eagle.core.function.hmi.ui.logcatch.LogInfoView import com.mogo.eagle.core.function.hmi.ui.widget.DemoModeView import com.mogo.eagle.core.utilcode.kotlin.currentPadding +import com.mogo.eagle.core.utilcode.kotlin.lifecycleOwner import com.mogo.eagle.core.utilcode.kotlin.onClick import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils import com.mogo.eagle.core.utilcode.mogo.logger.LogLevel @@ -74,17 +76,18 @@ import com.mogo.eagle.core.utilcode.mogo.toast.TipToast import com.mogo.eagle.core.utilcode.util.* import com.mogo.map.uicontroller.VisualAngleMode import com.mogo.map.uicontroller.VisualAngleMode.* -//import com.zhidao.easysocket.utils.L +import com.mogo.support.obu.MogoObuManager +import com.mogo.support.obu.constants.MogoObuLogLevel +import com.mogo.support.obu.option.MogoObuLog import com.zhjt.mogo_core_function_devatools.env.* import kotlinx.android.synthetic.main.view_debug_setting.view.* +import kotlinx.coroutines.launch import mogo.telematics.pad.MessagePad import mogo_msg.MogoReportMsg import java.text.SimpleDateFormat import java.util.* import kotlin.math.abs -import androidx.lifecycle.lifecycleScope -import kotlinx.coroutines.launch -import com.mogo.eagle.core.utilcode.kotlin.lifecycleOwner + /** * @author xiaoyuzhou @@ -1269,7 +1272,14 @@ internal class DebugSettingView @JvmOverloads constructor( * 设置是否输出OBU日志 true-打印日志,false-不打印日志 */ tbObuLog.setOnCheckedChangeListener { _, isChecked -> -// L.setEnableLog(isChecked) + MogoObuManager.getInstance().setEnableLog(isChecked) + + val builder: com.mogo.support.obu.option.MogoObuLog.Builder = + MogoObuLog.newBuilder().setEnableStdio(isChecked) + if (isChecked) { + builder.setStdioLevel(MogoObuLogLevel.DBG) + } + MogoObuManager.getInstance().logConfig(builder.build()) } /** From 2baf4aa785588d617c9e0412623558baf35aa7c2 Mon Sep 17 00:00:00 2001 From: renwj Date: Mon, 30 Jan 2023 19:11:06 +0800 Subject: [PATCH 07/18] =?UTF-8?q?[dev=5Farch=5Fopt=5F3.0][fix]=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3=E5=9B=A0=E4=BD=8D=E7=BD=AE=E5=9B=9E=E8=B0=83=E9=87=8D?= =?UTF-8?q?=E6=9E=84=E9=80=A0=E6=88=90=E7=9A=84v2x=E4=BA=8B=E4=BB=B6?= =?UTF-8?q?=E4=B8=8D=E6=98=BE=E7=A4=BA=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mogo/launcher/stageone/HttpDnsStartUp.kt | 17 +-- .../collect/MoGoMapDataCollectProvider.kt | 22 ++-- .../function/v2x/events/V2XEventManager.kt | 18 ++- .../v2x/events/marker/MarkerManager.kt | 30 +++-- .../scenario/scene/airoad/AiRoadMarker.kt | 15 +-- .../scene/road/V2XRoadEventScenario.java | 5 +- .../map/CallerMapLocationListenerManager.kt | 114 +----------------- .../call/map/CallerVisualAngleManager.kt | 8 +- .../java/com/mogo/map/AMapViewWrapper.java | 56 +-------- 9 files changed, 66 insertions(+), 219 deletions(-) diff --git a/app/src/main/java/com/mogo/launcher/stageone/HttpDnsStartUp.kt b/app/src/main/java/com/mogo/launcher/stageone/HttpDnsStartUp.kt index a189438325..42da7c05f5 100644 --- a/app/src/main/java/com/mogo/launcher/stageone/HttpDnsStartUp.kt +++ b/app/src/main/java/com/mogo/launcher/stageone/HttpDnsStartUp.kt @@ -29,8 +29,10 @@ import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_ALIAS_C import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_LINK_CLOUD import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_LINK_LOG_CONNECT_STATUS import com.mogo.eagle.core.data.map.MogoLocation +import com.mogo.eagle.core.function.api.autopilot.* import com.mogo.eagle.core.function.api.map.listener.IMoGoMapLocationListener import com.mogo.eagle.core.function.call.analytics.AnalyticsManager +import com.mogo.eagle.core.function.call.autopilot.* import com.mogo.eagle.core.function.call.cloud.CallerCloudListenerManager import com.mogo.eagle.core.function.call.map.CallerMapLocationListenerManager import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager @@ -45,6 +47,7 @@ import com.rousetime.android_startup.AndroidStartup import com.zhjt.mogo_core_function_devatools.env.EnvChangeManager import com.zhjt.service.chain.ChainLog import com.zhjt.service.chain.TracingConstants.Endpoint.Companion.PAD +import mogo.telematics.pad.MessagePad.GnssInfo class HttpDnsStartUp : AndroidStartup() { @@ -70,8 +73,7 @@ class HttpDnsStartUp : AndroidStartup() { override fun dependenciesByName(): List { return listOf( - "com.mogo.launcher.stageone.APMStartup", - "com.mogo.launcher.stageone.ThreadOptStartup" + "com.mogo.launcher.stageone.APMStartup" ) } @@ -292,17 +294,16 @@ class HttpDnsStartUp : AndroidStartup() { context?.let { MogoLocationInfoServices.getInstance().init(it) MogoLocationInfoServices.getInstance().start() - CallerMapLocationListenerManager.addListener( + CallerChassisLocationGCJ20ListenerManager.addListener( TAG, - object : IMoGoMapLocationListener { - override fun onLocationChanged( - location: MogoLocation?, from: Int, isGps: Boolean) { - location?.let { loc -> + object : IMoGoChassisLocationGCJ02Listener { + + override fun onChassisLocationGCJ02(gnssInfo: GnssInfo?) { + CallerMapLocationListenerManager.getCurrentLocation()?.let { loc -> MogoLocationInfoServices.getInstance().provideLocation(loc) } } }, - false ) } } diff --git a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/collect/MoGoMapDataCollectProvider.kt b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/collect/MoGoMapDataCollectProvider.kt index 5b429da8ba..83e51481df 100644 --- a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/collect/MoGoMapDataCollectProvider.kt +++ b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/collect/MoGoMapDataCollectProvider.kt @@ -10,23 +10,24 @@ import com.mogo.eagle.core.data.config.FunctionBuildConfig import com.mogo.eagle.core.data.constants.MogoServicePaths import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_MAP import com.mogo.eagle.core.data.map.MogoLocation -import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotRecordListener +import com.mogo.eagle.core.function.api.autopilot.* import com.mogo.eagle.core.function.api.map.collect.IMoGoMapDataCollectProvider import com.mogo.eagle.core.function.api.map.listener.IMoGoMapLocationListener -import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotRecordListenerManager +import com.mogo.eagle.core.function.call.autopilot.* import com.mogo.eagle.core.function.call.map.CallerMapDataCollectorManager import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger import com.mogo.eagle.core.function.call.map.CallerMapLocationListenerManager import com.zhidaoauto.map.operational.open.GatherApi import com.zhidaoauto.map.operational.open.GatherParams import com.zhidaoauto.map.operational.open.abs.OnTaskListener +import mogo.telematics.pad.MessagePad.GnssInfo import record_cache.RecordPanelOuterClass import java.util.concurrent.ConcurrentHashMap import java.util.concurrent.CopyOnWriteArrayList import java.util.concurrent.atomic.AtomicReference @Route(path = MogoServicePaths.PATH_MAP_DATA_COLLECT_PROVIDER) -class MoGoMapDataCollectProvider : IMoGoMapDataCollectProvider, OnTaskListener, IMoGoMapLocationListener, IMoGoTokenCallback, +class MoGoMapDataCollectProvider : IMoGoMapDataCollectProvider, OnTaskListener, IMoGoChassisLocationGCJ02Listener, IMoGoTokenCallback, IMoGoAutopilotRecordListener { companion object { @@ -52,7 +53,7 @@ class MoGoMapDataCollectProvider : IMoGoMapDataCollectProvider, OnTaskListener, override fun init(context: Context?) { - CallerMapLocationListenerManager.addListener(TAG, this, false) + CallerChassisLocationGCJ20ListenerManager.addListener(TAG, this) CallerAutopilotRecordListenerManager.addListener(TAG, this) executor.set(context?.let { @@ -74,7 +75,7 @@ class MoGoMapDataCollectProvider : IMoGoMapDataCollectProvider, OnTaskListener, override fun onDestroy() { CallerLogger.d("$M_MAP$TAG", "--------- onDestroy --------") - CallerMapLocationListenerManager.removeListener(TAG, false) + CallerChassisLocationGCJ20ListenerManager.removeListener(TAG) CallerAutopilotRecordListenerManager.removeListener(TAG) executor.get()?.setOnTaskListener(null) listeners.clear() @@ -170,18 +171,17 @@ class MoGoMapDataCollectProvider : IMoGoMapDataCollectProvider, OnTaskListener, } } - override fun onLocationChanged(location: MogoLocation?, from: Int, isGps: Boolean) { - location ?: return + override fun onChassisLocationGCJ02(gnssInfo: GnssInfo?) { + val location = CallerMapLocationListenerManager.getCurrentLocation() ?: return executor.get()?.updateLocation( - location.longitude, - location.latitude, + location.longitude, + location.latitude, location.altitude, location.bearing, location.speed, - isGps) + false) } - private fun isInValidStatus(): Boolean { if (map.isEmpty()) { return true diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/V2XEventManager.kt b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/V2XEventManager.kt index dbb4bdd0a6..711fde9e88 100644 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/V2XEventManager.kt +++ b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/V2XEventManager.kt @@ -24,10 +24,10 @@ import com.mogo.eagle.core.data.msgbox.MsgBoxBean import com.mogo.eagle.core.data.msgbox.MsgBoxType import com.mogo.eagle.core.data.msgbox.V2XMsg import com.mogo.eagle.core.data.traffic.* +import com.mogo.eagle.core.function.api.autopilot.* import com.mogo.eagle.core.function.api.hmi.warning.* import com.mogo.eagle.core.function.api.map.listener.* -import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager -import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotIdentifyListenerManager +import com.mogo.eagle.core.function.call.autopilot.* import com.mogo.eagle.core.function.call.hmi.* import com.mogo.eagle.core.function.call.map.* import com.mogo.eagle.core.function.call.map.CallerVisualAngleManager.Scene.Default @@ -72,12 +72,13 @@ import io.reactivex.disposables.Disposable import io.reactivex.schedulers.Schedulers import kotlinx.coroutines.* import kotlinx.coroutines.android.* +import mogo.telematics.pad.MessagePad.GnssInfo import tv.danmaku.ijk.media.player.* import java.util.concurrent.* import java.util.concurrent.atomic.* -object V2XEventManager : IMoGoMapLocationListener, IMoGoTokenCallback, IV2XCallback { +object V2XEventManager : IMoGoChassisLocationGCJ02Listener, IMoGoTokenCallback, IV2XCallback { private const val TAG = "V2XEventManager" @@ -87,8 +88,6 @@ object V2XEventManager : IMoGoMapLocationListener, IMoGoTokenCallback, IV2XCallb private val hasInit by lazy { AtomicBoolean(false) } - // 记录历史行驶轨迹,用于车行驶方向计算,只保留两个数据 - private val historyPath = arrayOfNulls(2) var v2xEventDisposable: Disposable? = null @@ -120,7 +119,7 @@ object V2XEventManager : IMoGoMapLocationListener, IMoGoTokenCallback, IV2XCallb private fun registerListener() { V2XManager.addCallback(this) - CallerMapLocationListenerManager.addListener(TAG, this, false) + CallerChassisLocationGCJ20ListenerManager.addListener(TAG, this) mogoMarkersHandler.registerMarkerClickListener(CARD_TYPE_ROAD_CONDITION, object : IMogoMarkerClickListener { override fun onMarkerClicked(marker: IMogoMarker?): Boolean { @@ -132,7 +131,7 @@ object V2XEventManager : IMoGoMapLocationListener, IMoGoTokenCallback, IV2XCallb private fun unRegisterListener() { V2XManager.removeCallback(this) - CallerMapLocationListenerManager.removeListener(TAG, false) + CallerChassisLocationGCJ20ListenerManager.removeListener(TAG) mogoMarkersHandler.unregisterMarkerClickListener(CARD_TYPE_ROAD_CONDITION) } @@ -206,8 +205,8 @@ object V2XEventManager : IMoGoMapLocationListener, IMoGoTokenCallback, IV2XCallb V2XScenarioManager.getInstance().handlerMessage(entity) } - override fun onLocationChanged(location: MogoLocation?, from: Int, isGps: Boolean) { - location ?: return + override fun onChassisLocationGCJ02(gnssInfo: GnssInfo?) { + val location = CallerMapLocationListenerManager.getCurrentLocation() ?: return BridgeApi.location.set(location) if (V2XManager.hasInit()) { V2XManager.onLocationChanged( @@ -218,7 +217,6 @@ object V2XEventManager : IMoGoMapLocationListener, IMoGoTokenCallback, IV2XCallb V2XOptimalRouteObserver.getInstance().update(location) refreshCarState(location) } - private fun refreshCarState(location: MogoLocation) { V2XStatusManager.getInstance().location = location val v2xPolyline = BridgeApi.v2xPolyline()?.mogoPolyline diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/marker/MarkerManager.kt b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/marker/MarkerManager.kt index 1039bbcd30..f738b3ab34 100644 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/marker/MarkerManager.kt +++ b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/marker/MarkerManager.kt @@ -4,12 +4,12 @@ import android.os.Handler import android.os.HandlerThread import android.util.Log import com.mogo.cloud.commons.utils.CoordinateUtils -import com.mogo.eagle.core.data.map.MogoLocation -import com.mogo.eagle.core.function.call.map.CallerMapLocationListenerManager +import com.mogo.eagle.core.function.call.autopilot.* import com.mogo.eagle.core.utilcode.util.* import com.mogo.map.marker.IMogoMarker import com.mogo.map.overlay.IMogoPolyline import kotlinx.coroutines.Runnable +import mogo.telematics.pad.MessagePad.GnssInfo import java.util.LinkedList import java.util.concurrent.ConcurrentHashMap import java.util.concurrent.atomic.AtomicBoolean @@ -64,9 +64,9 @@ object MarkerManager { private val elapsedDistances by lazy { ConcurrentHashMap() } - private val lastCarLocation by lazy { AtomicReference() } + private val lastCarLocation by lazy { AtomicReference>() } - private val lastGpsLocation by lazy { AtomicReference() } + private val lastGpsLocation by lazy { AtomicReference>() } private val checkTask = object : Runnable { @@ -83,21 +83,22 @@ object MarkerManager { } Log.d(TAG, "--- checkTask --- 3 ---") val toRemove = toRemoveMakers.iterator() - val carLoc = AtomicReference() + val carLoc = AtomicReference() while (toRemove.hasNext()) { val marker = toRemove.next() if (carLoc.get() == null) { carLoc.set(if (marker.coordinateType == 0) { //高德坐标 - CallerMapLocationListenerManager.getCurrentLocation() + CallerChassisLocationGCJ20ListenerManager.getChassisLocationGCJ02() } else { - CallerMapLocationListenerManager.getCurrentGpsLocation() + //高精坐标 + CallerChassisLocationWGS84ListenerManager.getChassisLocationWGS84() }) } val currentLocation = carLoc.get() val lastLocation = if (marker.coordinateType == 0) lastCarLocation.get() else lastGpsLocation.get() if (currentLocation != null && lastLocation != null) { - val delta = CoordinateUtils.calculateLineDistance(currentLocation.longitude, currentLocation.latitude, lastLocation.longitude, lastLocation.latitude) + val delta = CoordinateUtils.calculateLineDistance(currentLocation.longitude, currentLocation.latitude, lastLocation.first, lastLocation.second) Log.d(TAG, "--- checkTask --- 4 ---:delta:$delta, id:${marker.id}") var elapsed = elapsedDistances[marker] if (elapsed == null) { @@ -148,14 +149,15 @@ object MarkerManager { if (carLoc.get() == null) { carLoc.set(if (marker.coordinateType == 0) { //高德坐标 - CallerMapLocationListenerManager.getCurrentLocation() + CallerChassisLocationGCJ20ListenerManager.getChassisLocationGCJ02() } else { - CallerMapLocationListenerManager.getCurrentGpsLocation() + //高精坐标 + CallerChassisLocationWGS84ListenerManager.getChassisLocationWGS84() }) } val location = carLoc.get() if (location != null) { - val angle = DrivingDirectionUtils.getDegreeOfCar2Poi2(location.longitude, location.latitude, marker.lon, marker.lat, location.bearing.toDouble()) + val angle = DrivingDirectionUtils.getDegreeOfCar2Poi2(location.longitude, location.latitude, marker.lon, marker.lat, location.heading) if (angle >= 90) { iterator.remove() synchronized(toRemoveMakers) { @@ -167,8 +169,10 @@ object MarkerManager { } catch (t: Throwable) { t.printStackTrace() } finally { - lastCarLocation.set(CallerMapLocationListenerManager.getCurrentLocation()) - lastGpsLocation.set(CallerMapLocationListenerManager.getCurrentGpsLocation()) + val gcInfo = CallerChassisLocationGCJ20ListenerManager.getChassisLocationGCJ02() + lastCarLocation.set((gcInfo?.longitude ?: 0.0) to (gcInfo?.latitude ?: 0.0)) + val wgsInfo = CallerChassisLocationWGS84ListenerManager.getChassisLocationWGS84() + lastGpsLocation.set((wgsInfo?.longitude ?: 0.0) to (wgsInfo?.latitude ?: 0.0)) handler.postDelayed(this, 1000) } } diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/scene/airoad/AiRoadMarker.kt b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/scene/airoad/AiRoadMarker.kt index b653876cc6..ef0cb94abc 100644 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/scene/airoad/AiRoadMarker.kt +++ b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/scene/airoad/AiRoadMarker.kt @@ -10,6 +10,7 @@ import com.mogo.cloud.commons.utils.* import com.mogo.commons.AbsMogoApplication import com.mogo.eagle.core.data.map.MogoLatLng import com.mogo.eagle.core.data.map.entity.V2XRoadEventEntity +import com.mogo.eagle.core.function.call.autopilot.* import com.mogo.eagle.core.function.call.map.* import com.mogo.eagle.core.function.v2x.events.scenario.scene.road.V2XAiRoadEventMarker import com.mogo.eagle.core.utilcode.mogo.logger.Logger @@ -61,7 +62,7 @@ class AiRoadMarker { private val checkExpiredTask = Runnable { val poi = this.marker.get() - val car = CallerMapLocationListenerManager.getCurrentGpsLocation() + val car = CallerChassisLocationWGS84ListenerManager.getChassisLocationWGS84() if (poi != null && car != null) { val distance = CoordinateUtils.calculateLineDistance(car.longitude, car.latitude, poi.poi_lon, poi.poi_lat) if (distance < 500) { @@ -80,7 +81,7 @@ class AiRoadMarker { } fun marker(marker: Marker, drawMarker: Boolean, drawRoadLine: Boolean = false) { - val location = CallerMapLocationListenerManager.getCurrentGpsLocation() ?: return + val location = CallerChassisLocationWGS84ListenerManager.getChassisLocationWGS84() ?: return this.marker.set(marker) val wrapper = MarkerWrapper(marker.id, marker.poi_lon, marker.poi_lat, 1, null, null) if (drawMarker) { @@ -88,10 +89,10 @@ class AiRoadMarker { } if (drawRoadLine) { //施工中心点前方的自车行驶方向上300米距离 - val l1 = MogoMap.getInstance().mogoMap.getCenterLineRangeInfo(marker.poi_lon, marker.poi_lat, location.bearing, 300f) + val l1 = MogoMap.getInstance().mogoMap.getCenterLineRangeInfo(marker.poi_lon, marker.poi_lat, location.heading.toFloat(), 300f) //施工中心点后方的自车行驶方向上300米距离 Logger.d(TAG, "--- marker --- 3 --- l1: $l1") - val l2 = MogoMap.getInstance().mogoMap.getCenterLineRangeInfo(marker.poi_lon, marker.poi_lat, location.bearing, -300f) + val l2 = MogoMap.getInstance().mogoMap.getCenterLineRangeInfo(marker.poi_lon, marker.poi_lat, location.heading.toFloat(), -300f) if (l1.points.isEmpty() || l2.points.isEmpty()) { Logger.d(TAG, "--- marker --- 3 --- return ----") return @@ -110,7 +111,7 @@ class AiRoadMarker { var find: Pair = Pair(centerX, centerY) var min = Long.MAX_VALUE for (p in it) { - val angle = DrivingDirectionUtils.getDegreeOfCar2Poi2(centerX, centerY, p.first, p.second, location.bearing.toDouble()) + val angle = DrivingDirectionUtils.getDegreeOfCar2Poi2(centerX, centerY, p.first, p.second, location.heading) if (angle < min) { min = angle find = p @@ -122,7 +123,7 @@ class AiRoadMarker { Logger.d(TAG, "--- marker --- 6 --- marker: $marker") if (l1 != null && l1.points.isNotEmpty()) { for (l in l1.points) { - if (DrivingDirectionUtils.getDegreeOfCar2Poi2(farthestPoint.lon, farthestPoint.lat, l.first, l.second, (location.bearing + 180).toDouble()) < 90L) { + if (DrivingDirectionUtils.getDegreeOfCar2Poi2(farthestPoint.lon, farthestPoint.lat, l.first, l.second, (location.heading + 180)) < 90L) { points.add(l.let { MogoLatLng(it.second, it.first) }) } } @@ -180,7 +181,7 @@ class AiRoadMarker { fun receive() { Logger.d(TAG, "receive --- 1 ---") val poi = this.marker.get() - val car = CallerMapLocationListenerManager.getCurrentGpsLocation() + val car = CallerChassisLocationWGS84ListenerManager.getChassisLocationWGS84() if (poi != null && car != null) { val distance = CoordinateUtils.calculateLineDistance(car.longitude, car.latitude, poi.poi_lon, poi.poi_lat) Logger.d(TAG, "receive --- 2 ---:car:[${car.longitude}, ${car.latitude}] -> poi:[${poi.poi_lon}, ${poi.poi_lat}] --> distance:$distance") diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/scene/road/V2XRoadEventScenario.java b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/scene/road/V2XRoadEventScenario.java index 5441044185..98998db728 100644 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/scene/road/V2XRoadEventScenario.java +++ b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/scene/road/V2XRoadEventScenario.java @@ -17,6 +17,7 @@ import com.mogo.eagle.core.data.msgbox.MsgBoxBean; import com.mogo.eagle.core.data.msgbox.MsgBoxType; import com.mogo.eagle.core.data.msgbox.V2XMsg; import com.mogo.eagle.core.function.api.hmi.warning.IMoGoWarningStatusListener; +import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ20ListenerManager; import com.mogo.eagle.core.function.call.hmi.CallerHmiManager; import com.mogo.eagle.core.function.call.map.CallerMapLocationListenerManager; import com.mogo.eagle.core.function.call.map.CallerVisualAngleManager; @@ -31,6 +32,7 @@ import java.util.Map; import java.util.Objects; import java.util.concurrent.TimeUnit; +import mogo.telematics.pad.MessagePad; /** @@ -123,9 +125,8 @@ public class V2XRoadEventScenario extends AbsV2XScenario imp EventTypeEnumNew. TYPE_SOCKET_ROAD_JINGZHI.getPoiType().equals(poiType) || EventTypeEnumNew.TYPE_SOCKET_ROAD_CONGESTION.getPoiType().equals(poiType) || EventTypeEnumNew.TYPE_SOCKET_ROAD_SHIGU.getPoiType().equals(poiType)) { - MogoLocation carLocation = CallerMapLocationListenerManager.INSTANCE.getCurrentLocation(); MarkerExploreWay noveltyInfo = content.getNoveltyInfo(); - if (carLocation != null && noveltyInfo != null) { + if (noveltyInfo != null) { MarkerLocation eventLocation = noveltyInfo.getLocation(); if (eventLocation != null) { double distance = content.getDistance(); 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 c779e1e802..08ab9ff67f 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 @@ -13,21 +13,9 @@ import java.util.concurrent.ConcurrentHashMap object CallerMapLocationListenerManager : CallerBase() { // 记录地图最后一次位置 + @Volatile private var mLocation: MogoLocation? = null - /** - * 记录最后一次高精坐标的位置 - */ - private var mGpsLocation: MogoLocation? = null - - // 存储所有注册了监听的对象,invokeXXXX进行遍历回调,将信息同步 - private val mMapStyleChangeListeners: ConcurrentHashMap = - ConcurrentHashMap() - - - // 高精坐标回调 - private val mGpsChangedListeners: ConcurrentHashMap = ConcurrentHashMap() - /** * 获取当前经纬度 */ @@ -35,103 +23,7 @@ object CallerMapLocationListenerManager : CallerBase() { return mLocation } - /** - * 获取当前高精坐标 - */ - fun getCurrentGpsLocation(): MogoLocation? { - return mGpsLocation - } - - /** - * 添加 地图样式改变 监听 - * @param tag 标记,用来注销监听使用 - * @param listener 监听回调 - */ - fun addListener(tag: String, listener: IMoGoMapLocationListener, isGps: Boolean) { - if (!isGps) { - if (mMapStyleChangeListeners.containsKey(tag)) { - return - } - mMapStyleChangeListeners[tag] = listener - listener.onLocationChanged(mLocation, 0, isGps) - } else { - if (mGpsChangedListeners.containsKey(tag)) { - return - } - mGpsChangedListeners[tag] = listener - listener.onLocationChanged(mGpsLocation, 0, isGps) - } - - } - - /** - * 删除 地图样式改变 监听 - * @param tag 标记,用来注销监听使用 - */ - fun removeListener(tag: String, isGps: Boolean) { - if (!isGps) { - if (!mMapStyleChangeListeners.containsKey(tag)) { - return - } - mMapStyleChangeListeners.remove(tag) - } else { - if (!mGpsChangedListeners.containsKey(tag)) { - return - } - mGpsChangedListeners.remove(tag) - } - - } - - /** - * 删除 地图样式改变 监听 - * @param listener 要删除的监听对象 - */ - fun removeListener(listener: IMoGoMapLocationListener, isGps: Boolean) { - if (!isGps) { - if (!mMapStyleChangeListeners.containsValue(listener)) { - return - } - mMapStyleChangeListeners.forEach { - if (it.value == listener) { - mMapStyleChangeListeners.remove(it.key) - } - } - } else { - if (!mGpsChangedListeners.containsValue(listener)) { - return - } - mGpsChangedListeners.forEach { - if (it.value == listener) { - mGpsChangedListeners.remove(it.key) - } - } - } - } - - /** - * 触发 地图样式改变 监听 - */ - fun invokeMapLocationChangeListener() { - invokeMapLocationChangeListener(mLocation, 0, false) - } - - /** - * 触发 地图样式改变 监听 - * @param location 选中状态 - */ - fun invokeMapLocationChangeListener(location: MogoLocation?, from: Int, isGps: Boolean) { - if (!isGps) { - mLocation = location - mMapStyleChangeListeners.forEach { - val listener = it.value - listener.onLocationChanged(location, from, isGps) - } - } else { - mGpsLocation = location - mGpsChangedListeners.forEach { - it.value.onLocationChanged(location, from, isGps) - } - } + fun setCurrentLocation(location: MogoLocation) { + mLocation = location } } \ No newline at end of file diff --git a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/map/CallerVisualAngleManager.kt b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/map/CallerVisualAngleManager.kt index 75b7b224e5..5e314cb6aa 100644 --- a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/map/CallerVisualAngleManager.kt +++ b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/map/CallerVisualAngleManager.kt @@ -12,6 +12,7 @@ import androidx.lifecycle.LifecycleOwner import com.mogo.eagle.core.data.config.FunctionBuildConfig import com.mogo.eagle.core.data.map.* import com.mogo.eagle.core.data.map.MapRoadInfo.StopLine +import com.mogo.eagle.core.function.call.autopilot.* import com.mogo.eagle.core.function.call.map.CallerMapRoadListenerManager.OnRoadListener import com.mogo.eagle.core.function.call.map.CallerVisualAngleManager.Scene.* import com.mogo.eagle.core.utilcode.kotlin.lifeCycleOwner @@ -23,6 +24,7 @@ import com.zhidaoauto.map.sdk.open.tools.MapTools import kotlinx.coroutines.* import kotlinx.coroutines.android.asCoroutineDispatcher import kotlinx.coroutines.internal.synchronized +import mogo.telematics.pad.MessagePad.GnssInfo import java.util.* import java.util.concurrent.TimeUnit import java.util.concurrent.TimeUnit.SECONDS @@ -63,7 +65,7 @@ object CallerVisualAngleManager { val displayThreshold: Long //最大展示时长 > 0; 表示最长展示多长时间, -1 表示,一直展示,直到触发默认视角, 0: 默认视角专用值, } - private val triggerLocation = AtomicReference() + private val triggerLocation = AtomicReference() private val distanceOfCarToStopLine = AtomicReference(0.0) @@ -76,7 +78,7 @@ object CallerVisualAngleManager { override fun onRoadIdInfo(roadId: String) { this.roadId.set(roadId) Log.d(TAG, "-- onRoadIdInfo --: prev: ${this.triggerRoadId.get()} -> curr: $roadId") - val loc = CallerMapLocationListenerManager.getCurrentLocation() + val loc = CallerChassisLocationGCJ20ListenerManager.getChassisLocationGCJ02() var triggerClose = false val distance = distanceOfCarToStopLine.get() + 5 if (hasCrossRoad && distance > 0) { @@ -109,7 +111,7 @@ object CallerVisualAngleManager { hasCrossRoad = true triggerRoadId.set(this.roadId.get()) distanceOfCarToStopLine.set(info.distanceOfCarToStopLine) - triggerLocation.set(CallerMapLocationListenerManager.getCurrentLocation()) + triggerLocation.set(CallerChassisLocationGCJ20ListenerManager.getChassisLocationGCJ02()) changeVisualAngle(CrossRoad(true)) } } 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 80f9e2a682..075f159e6f 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 @@ -121,10 +121,6 @@ public class AMapViewWrapper implements IMogoMapView, private boolean mIsFirstLocated = true; private boolean mIsDelayed = false; - // GPS 位置回调 - private final LocationListener mGpsLocationListener = - location -> CallerMapLocationListenerManager.INSTANCE.invokeMapLocationChangeListener(ObjectUtils.fromLocation(location), 0, true); - public AMapViewWrapper(MapAutoView mMapView) { CallerLogger.INSTANCE.i(M_MAP + TAG, "autoop--AMapViewWrapper: init"); this.mMapView = mMapView; @@ -189,7 +185,6 @@ public class AMapViewWrapper implements IMogoMapView, LocationClient client = mMapView.getLocationClient(); if (client != null) { client.registerListener(this); - client.registerGpsListener(mGpsLocationListener); } mMapView.registerListener(this, MapAutoApi.LISTENER_TYPE_ZOOM); mMapView.registerListener(this, MapAutoApi.LISTENER_TYPE_ROTATE); @@ -704,45 +699,12 @@ public class AMapViewWrapper implements IMogoMapView, CallerMapDevaListenerManager.INSTANCE.invokeUploadLogFile(filePath); } - // TODO 这里需要数据中心代理 -// private static class LocationTask implements Runnable { -// -// private MogoLocation location; -// -// public void setMoGoLocation(MogoLocation location) { -// this.location = location; -// } -// -// @Override -// public void run() { -// if (location != null) { -// CallerMapLocationListenerManager.INSTANCE.invokeMapLocationChangeListener(location, 1, false); -// location = null; -// } -// } -// } - -// private volatile LocationTask mLocationTask; - -// private final Handler mainHandler = new Handler(Looper.getMainLooper()); - @Override public void onLocationChanged(@NotNull com.zhidaoauto.map.sdk.open.location.MogoLocation location) { -// MogoLocation currentLocation = ObjectUtils.fromLocation(location); -// if (Looper.myLooper() == Looper.getMainLooper()) { -// CallerMapLocationListenerManager.INSTANCE.invokeMapLocationChangeListener(currentLocation, 1, false); -// } else { -// if (mLocationTask == null) { -// mLocationTask = new LocationTask(); -// } -// mLocationTask.setMoGoLocation(currentLocation); -// mainHandler.removeCallbacks(mLocationTask); -// mainHandler.post(mLocationTask); -// } - + CallerMapLocationListenerManager.INSTANCE.setCurrentLocation(ObjectUtils.fromLocation(location)); // 将有效经纬度暂存本地,提供给下一次的Http-DNS使用,防止首次请求位置获取不到 if (location.getLat() > 0 && location.getLon() > 0) { - if (location.getCityCode() != null && !location.getCityCode().isEmpty()) { + if (location.getCityCode() != null && !location.getCityCode().isEmpty()) { SharedPrefsMgr.getInstance(mMapView.getContext()) .putString(SharedPrefsConstants.LOCATION_CITY_CODE, location.getCityCode()); } @@ -752,20 +714,6 @@ public class AMapViewWrapper implements IMogoMapView, .putString(SharedPrefsConstants.LOCATION_LONGITUDE, String.valueOf(location.getLon())); } -// // 同步给各个模块 -// Location sysLocation = new Location(location.getProvider()); -// sysLocation.setAltitude(location.getAltitude()); -// sysLocation.setLatitude(location.getLat()); -// sysLocation.setLongitude(location.getLon()); -// sysLocation.setProvider(location.getProvider()); -// sysLocation.setAccuracy(location.getAcceleration()); -// sysLocation.setTime(location.duration); -// sysLocation.setBearing((float) location.getHeading()); -// sysLocation.setSpeed(location.getSpeed()); - -// if (MogoCarLocationChangedListenerRegister.getInstance().getListener() != null) { -// MogoCarLocationChangedListenerRegister.getInstance().getListener().onCarLocationChanged2(sysLocation); -// } if (checkAMapView() && mMapLoaded) { // 地图初始化完成后,每隔5s自动判断当前地图的模式 if (mIsFirstLocated) { From d46c11767da1080833e779a5da5c60c95cfd1a68 Mon Sep 17 00:00:00 2001 From: zhongchao Date: Mon, 30 Jan 2023 22:28:02 +0800 Subject: [PATCH 08/18] [2.13.0-arch-opt] merg --- OCH/mogo-och-bus-passenger/build.gradle | 12 +- .../main/res/layout/bus_p_base_fragment.xml | 22 +- OCH/mogo-och-bus/build.gradle | 13 - .../src/main/res/layout/bus_base_fragment.xml | 41 +- OCH/mogo-och-common-module/build.gradle | 22 +- .../java/com/mogo/och/noop/OchNoopFragment.kt | 18 +- .../main/res/layout/och_noop_fragment_hmi.xml | 13 +- OCH/mogo-och-sweeper/build.gradle | 13 - .../view/SweeperLimitingVelocityView.java | 33 - .../view/SweeperLimitingVelocityView.kt | 54 ++ .../sweeper/view/SweeperTrafficDataView.java | 17 +- .../main/res/layout/sweeper_base_fragment.xml | 51 ++ OCH/mogo-och-taxi-passenger/build.gradle | 12 +- .../passenger/model/TaxiPassengerModel.java | 10 +- .../main/res/layout/taxi_p_base_fragment.xml | 22 +- OCH/mogo-och-taxi/build.gradle | 12 +- .../main/res/layout/taxi_base_fragment.xml | 41 +- .../com/mogo/launcher/stageone/APMStartup.kt | 2 +- .../mogo/launcher/stageone/ConfigStartUp.kt | 8 - .../v2x/speedlimit/SpeedLimitDataManager.java | 6 +- .../v2x/speedlimit/SpeedLimitDispatcher.kt | 66 +- .../datacenter/obu/MogoObuDcCombineManager.kt | 9 +- .../obu/MogoPrivateObuNewManager.kt | 809 +++++++++--------- .../V2XLimitingVelocityBroadcastReceiver.kt | 10 +- .../core/function/hmi/ui/MoGoHmiFragment.kt | 114 +-- .../hmi/ui/setting/DebugSettingView.kt | 43 - .../function/hmi/ui/setting/SOPSettingView.kt | 4 +- .../function/hmi/ui/tools/ToolsImageView.kt | 16 +- .../hmi/ui/widget/AutoPilotStatusView.kt | 13 +- .../core/function/hmi/ui/widget/CameraView.kt | 15 +- .../hmi/ui/widget/LimitingVelocityView.kt | 54 +- .../hmi/ui/widget/PerspectiveSwitchView.kt | 17 +- .../function/hmi/ui/widget/SpeedPanelView.kt | 14 +- .../function/hmi/ui/widget/StatusBarView.kt | 2 + .../hmi/ui/widget/VipIdentificationView.kt | 20 +- .../src/main/res/layout/fragment_hmi.xml | 66 -- .../main/res/layout/view_debug_setting.xml | 48 -- .../res/layout/view_limiting_speed_vr.xml | 22 +- .../src/main/res/values/attr.xml | 5 - .../function/v2x/events/V2XEventManager.kt | 2 +- .../eagle/core/data/enums/DataSourceType.kt | 11 + .../eagle/core/data/msgbox/DataSourceType.kt | 9 - .../mogo/eagle/core/data/msgbox/MsgBoxBean.kt | 2 + .../function/api/hmi/IMoGoHmiViewProxy.kt | 8 - .../api/hmi/view/IViewControlListener.kt | 6 +- .../api/hmi/view/IViewLimitingVelocity.kt | 19 - .../api/hmi/warning/IMoGoHmiProvider.kt | 46 - .../api/v2x/ILimitingVelocityListener.kt | 10 + .../api/v2x/LimitingVelocityListener.kt | 8 - .../api/v2x/ObuLimitingSpeedListener.kt | 8 - .../function/call/hmi/CallerHmiManager.kt | 67 -- .../CallLimitingVelocityListenerManager.kt | 29 - .../CallObuLimitingSpeedListenerManager.kt | 26 - .../CallerLimitingVelocityListenerManager.kt | 28 + ...llerViewLimitingVelocityListenerManager.kt | 28 + 55 files changed, 895 insertions(+), 1181 deletions(-) delete mode 100644 OCH/mogo-och-sweeper/src/main/java/com/mogo/och/sweeper/view/SweeperLimitingVelocityView.java create mode 100644 OCH/mogo-och-sweeper/src/main/java/com/mogo/och/sweeper/view/SweeperLimitingVelocityView.kt create mode 100644 core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/enums/DataSourceType.kt delete mode 100644 core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/msgbox/DataSourceType.kt delete mode 100644 core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/hmi/view/IViewLimitingVelocity.kt create mode 100644 core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/v2x/ILimitingVelocityListener.kt delete mode 100644 core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/v2x/LimitingVelocityListener.kt delete mode 100644 core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/v2x/ObuLimitingSpeedListener.kt delete mode 100644 core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/v2x/CallLimitingVelocityListenerManager.kt delete mode 100644 core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/v2x/CallObuLimitingSpeedListenerManager.kt create mode 100644 core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/v2x/CallerLimitingVelocityListenerManager.kt create mode 100644 core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/v2x/CallerViewLimitingVelocityListenerManager.kt diff --git a/OCH/mogo-och-bus-passenger/build.gradle b/OCH/mogo-och-bus-passenger/build.gradle index 0677d0aacd..8749b55ad1 100644 --- a/OCH/mogo-och-bus-passenger/build.gradle +++ b/OCH/mogo-och-bus-passenger/build.gradle @@ -53,18 +53,10 @@ dependencies { implementation rootProject.ext.dependencies.amapnavi3dmap implementation project(":OCH:mogo-och-common-module") if (Boolean.valueOf(USE_MAVEN_PACKAGE)) { - implementation rootProject.ext.dependencies.mogoutils - implementation rootProject.ext.dependencies.mogocommons - implementation rootProject.ext.dependencies.mogo_core_data - implementation rootProject.ext.dependencies.mogo_core_function_call - implementation rootProject.ext.dependencies.mogo_core_function_hmi + implementation rootProject.ext.dependencies.mogo_core_function_v2x }else { implementation project(':foudations:mogo-aicloud-services-sdk') - implementation project(":foudations:mogo-commons") - implementation project(':core:mogo-core-data') - implementation project(":core:mogo-core-utils") - implementation project(':core:mogo-core-function-call') - implementation project(':core:function-impl:mogo-core-function-hmi') + implementation project(':core:function-impl:mogo-core-function-v2x') } } diff --git a/OCH/mogo-och-bus-passenger/src/main/res/layout/bus_p_base_fragment.xml b/OCH/mogo-och-bus-passenger/src/main/res/layout/bus_p_base_fragment.xml index 59714c2b32..564aa1e394 100644 --- a/OCH/mogo-och-bus-passenger/src/main/res/layout/bus_p_base_fragment.xml +++ b/OCH/mogo-och-bus-passenger/src/main/res/layout/bus_p_base_fragment.xml @@ -31,11 +31,29 @@ android:layout_width="@dimen/module_vip_width" android:layout_height="@dimen/module_vip_height" android:visibility="gone" - app:marginStart="@dimen/dp_640" - app:marginTop="@dimen/dp_80" + android:layout_marginStart="@dimen/dp_640" + android:layout_marginTop="@dimen/dp_80" app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintTop_toTopOf="parent"/> + + + + + + + android:layout_marginStart="@dimen/dp_640" + android:layout_marginTop="@dimen/dp_80"/> + + + + + + + + + + + + (), @@ -32,14 +26,6 @@ class OchNoopFragment : MvpFragment(), override fun initViews() { - //设置StatusBar初始状态 - CallerHmiViewControlListenerManager.updateStatusBarRightView( - StatusBarView.TAG, - FunctionBuildConfig.isDemoMode, - "demoMode", - DemoModeView(requireContext()) - ) - viewShowDebugView.setOnLongClickListener { ToggleDebugView.toggleDebugView.toggle(requireContext()) true @@ -51,7 +37,7 @@ class OchNoopFragment : MvpFragment(), viewDriverMsgBoxList.notifyData() viewDriverMsgBoxBubble.visibility = View.GONE viewDriverMsgBoxBubble.isShowData(false) - CallerHmiManager.updateDriverMsgBoxTipView(false) + MsgBoxTipView.visibility = View.GONE } else { viewDriverMsgBoxList.visibility = View.GONE viewDriverMsgBoxBubble.visibility = View.VISIBLE @@ -64,7 +50,7 @@ class OchNoopFragment : MvpFragment(), viewPassengerMsgBoxList.visibility = View.VISIBLE viewPassengerMsgBoxBubble.visibility = View.GONE viewPassengerMsgBoxBubble.isShowData(false) - CallerHmiManager.updatePassengerMsgBoxTipView(false) + MsgBoxTipView.visibility = View.GONE } else { viewPassengerMsgBoxList.visibility = View.GONE viewPassengerMsgBoxBubble.visibility = View.VISIBLE diff --git a/OCH/mogo-och-noop/src/main/res/layout/och_noop_fragment_hmi.xml b/OCH/mogo-och-noop/src/main/res/layout/och_noop_fragment_hmi.xml index 2638954937..fb1bec67f4 100644 --- a/OCH/mogo-och-noop/src/main/res/layout/och_noop_fragment_hmi.xml +++ b/OCH/mogo-och-noop/src/main/res/layout/och_noop_fragment_hmi.xml @@ -43,13 +43,14 @@ - - \ No newline at end of file diff --git a/OCH/mogo-och-sweeper/build.gradle b/OCH/mogo-och-sweeper/build.gradle index faa8d4934e..0a74593753 100644 --- a/OCH/mogo-och-sweeper/build.gradle +++ b/OCH/mogo-och-sweeper/build.gradle @@ -55,19 +55,6 @@ dependencies { implementation project(":OCH:mogo-och-common-module") implementation rootProject.ext.dependencies.androidxrecyclerview - if (Boolean.valueOf(USE_MAVEN_PACKAGE)) { - implementation rootProject.ext.dependencies.mogoutils - implementation rootProject.ext.dependencies.mogocommons - implementation rootProject.ext.dependencies.mogo_core_data - implementation rootProject.ext.dependencies.mogo_core_function_call - implementation rootProject.ext.dependencies.mogo_core_function_hmi - }else { - implementation project(":core:mogo-core-utils") - implementation project(":foudations:mogo-commons") - implementation project(':core:mogo-core-data') - implementation project(':core:mogo-core-function-call') - implementation project(':core:function-impl:mogo-core-function-hmi') - } } apply from: new File(rootProject.rootDir, "gradle/upload.gradle").toString() \ No newline at end of file diff --git a/OCH/mogo-och-sweeper/src/main/java/com/mogo/och/sweeper/view/SweeperLimitingVelocityView.java b/OCH/mogo-och-sweeper/src/main/java/com/mogo/och/sweeper/view/SweeperLimitingVelocityView.java deleted file mode 100644 index b8831bae9f..0000000000 --- a/OCH/mogo-och-sweeper/src/main/java/com/mogo/och/sweeper/view/SweeperLimitingVelocityView.java +++ /dev/null @@ -1,33 +0,0 @@ -package com.mogo.och.sweeper.view; - -import android.content.Context; -import android.util.AttributeSet; -import android.view.LayoutInflater; -import android.widget.TextView; - -import com.mogo.eagle.core.function.api.hmi.view.IViewLimitingVelocity; -import com.mogo.och.sweeper.R; - -import androidx.annotation.NonNull; -import androidx.annotation.Nullable; - -public class SweeperLimitingVelocityView extends IViewLimitingVelocity { - private TextView limitingVelocity; - - public SweeperLimitingVelocityView(@Nullable Context context, @Nullable AttributeSet attrs, int defStyleAttr) { - super(context, attrs, defStyleAttr); - } - public SweeperLimitingVelocityView(@Nullable Context context, @Nullable AttributeSet attrs) { - this(context,attrs,0); - initView(context); - } - @Override - public void updateLimitingSpeed(int limitingSpeed, int limitSource) { - super.updateLimitingSpeed(limitingSpeed, limitSource); - limitingVelocity.setText(String.valueOf(limitingSpeed)); - } - private void initView(@NonNull Context context) { - LayoutInflater.from(context).inflate(R.layout.sweeper_limiting_speed, this); - limitingVelocity = findViewById(R.id.tvLimitingVelocity); - } -} diff --git a/OCH/mogo-och-sweeper/src/main/java/com/mogo/och/sweeper/view/SweeperLimitingVelocityView.kt b/OCH/mogo-och-sweeper/src/main/java/com/mogo/och/sweeper/view/SweeperLimitingVelocityView.kt new file mode 100644 index 0000000000..c4761b07e2 --- /dev/null +++ b/OCH/mogo-och-sweeper/src/main/java/com/mogo/och/sweeper/view/SweeperLimitingVelocityView.kt @@ -0,0 +1,54 @@ +package com.mogo.och.sweeper.view + +import android.content.Context +import android.util.AttributeSet +import android.view.LayoutInflater +import android.view.View +import android.widget.LinearLayout +import com.mogo.eagle.core.data.enums.DataSourceType +import com.mogo.eagle.core.function.api.hmi.view.IViewControlListener +import com.mogo.eagle.core.function.api.hmi.view.IViewControlListener.Companion.LimitingVelocityView_TAG +import com.mogo.eagle.core.function.api.v2x.ILimitingVelocityListener +import com.mogo.eagle.core.function.call.hmi.CallerHmiViewControlListenerManager +import com.mogo.eagle.core.function.call.v2x.CallerViewLimitingVelocityListenerManager +import com.mogo.och.sweeper.R +import kotlinx.android.synthetic.main.sweeper_limiting_speed.view.* + +class SweeperLimitingVelocityView(context: Context?, attrs: AttributeSet?, defStyleAttr: Int) : + LinearLayout(context, attrs, defStyleAttr), ILimitingVelocityListener, IViewControlListener { + + companion object { + private const val TAG = "SweeperLimitingVelocityView" + } + + init { + LayoutInflater.from(context).inflate(R.layout.sweeper_limiting_speed, this) + } + + override fun onAttachedToWindow() { + super.onAttachedToWindow() + CallerViewLimitingVelocityListenerManager.addListener(TAG, this) + CallerHmiViewControlListenerManager.addListener(LimitingVelocityView_TAG, this) + } + + override fun onLimitingVelocityChange(limitingVelocity: Int, sourceType: DataSourceType) { + if (limitingVelocity > 0) { + tvLimitingVelocity.visibility = View.VISIBLE + tvLimitingVelocity.text = "$limitingVelocity" + } else { + tvLimitingVelocity.visibility = View.GONE + } + } + + override fun visible(v: Int) { + super.visible(v) + tvLimitingVelocity.visibility = v + } + + override fun onDetachedFromWindow() { + super.onDetachedFromWindow() + CallerViewLimitingVelocityListenerManager.removeListener(TAG) + CallerHmiViewControlListenerManager.removeListener(LimitingVelocityView_TAG) + } + +} \ No newline at end of file diff --git a/OCH/mogo-och-sweeper/src/main/java/com/mogo/och/sweeper/view/SweeperTrafficDataView.java b/OCH/mogo-och-sweeper/src/main/java/com/mogo/och/sweeper/view/SweeperTrafficDataView.java index 11aaf92603..23cc010b44 100644 --- a/OCH/mogo-och-sweeper/src/main/java/com/mogo/och/sweeper/view/SweeperTrafficDataView.java +++ b/OCH/mogo-och-sweeper/src/main/java/com/mogo/och/sweeper/view/SweeperTrafficDataView.java @@ -10,15 +10,15 @@ import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.constraintlayout.widget.ConstraintLayout; +import com.mogo.eagle.core.data.enums.DataSourceType; import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisGearStateListener; import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLamplightListener; import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisSteeringStateListener; -import com.mogo.eagle.core.function.api.v2x.LimitingVelocityListener; -import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotVehicleStateListenerManager; +import com.mogo.eagle.core.function.api.v2x.ILimitingVelocityListener; import com.mogo.eagle.core.function.call.autopilot.CallerChassisGearStateListenerManager; import com.mogo.eagle.core.function.call.autopilot.CallerChassisLamplightListenerManager; import com.mogo.eagle.core.function.call.autopilot.CallerChassisSteeringStateListenerManager; -import com.mogo.eagle.core.function.call.v2x.CallLimitingVelocityListenerManager; +import com.mogo.eagle.core.function.call.v2x.CallerLimitingVelocityListenerManager; import com.mogo.eagle.core.function.hmi.ui.widget.TapPositionView; import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger; import com.mogo.eagle.core.utilcode.util.ThreadUtils; @@ -26,9 +26,6 @@ import com.mogo.och.sweeper.R; import org.jetbrains.annotations.NotNull; -import androidx.annotation.NonNull; -import androidx.annotation.Nullable; -import androidx.constraintlayout.widget.ConstraintLayout; import chassis.Chassis; import chassis.VehicleStateOuterClass; @@ -75,7 +72,7 @@ public class SweeperTrafficDataView extends ConstraintLayout CallerChassisSteeringStateListenerManager.INSTANCE.addListener(TAG, this); CallerChassisGearStateListenerManager.INSTANCE.addListener(TAG, this); //增加限速监听 - CallLimitingVelocityListenerManager.INSTANCE.addListener(TAG,limitingVelocityListener); + CallerLimitingVelocityListenerManager.INSTANCE.addListener(TAG,limitingVelocityListener); } @Override @@ -85,7 +82,7 @@ public class SweeperTrafficDataView extends ConstraintLayout CallerChassisLamplightListenerManager.INSTANCE.removeListener(TAG); CallerChassisSteeringStateListenerManager.INSTANCE.removeListener(TAG); CallerChassisGearStateListenerManager.INSTANCE.removeListener(TAG); - CallLimitingVelocityListenerManager.INSTANCE.removeListener(limitingVelocityListener); + CallerLimitingVelocityListenerManager.INSTANCE.removeListener(limitingVelocityListener); } /** @@ -146,10 +143,10 @@ public class SweeperTrafficDataView extends ConstraintLayout /** * 限速监听 */ - private final LimitingVelocityListener limitingVelocityListener = new LimitingVelocityListener(){ + private final ILimitingVelocityListener limitingVelocityListener = new ILimitingVelocityListener(){ @Override - public void onLimitingVelocityChange(int limitingVelocity) { + public void onLimitingVelocityChange(int limitingVelocity, DataSourceType sourceType) { //设置限速 sweeperLimitingVelocity.updateLimitingSpeed(limitingVelocity, 0); } diff --git a/OCH/mogo-och-sweeper/src/main/res/layout/sweeper_base_fragment.xml b/OCH/mogo-och-sweeper/src/main/res/layout/sweeper_base_fragment.xml index aa7a2a60ad..c4c85c96b3 100644 --- a/OCH/mogo-och-sweeper/src/main/res/layout/sweeper_base_fragment.xml +++ b/OCH/mogo-och-sweeper/src/main/res/layout/sweeper_base_fragment.xml @@ -21,6 +21,57 @@ android:layout_height="match_parent" /> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + () { } override fun dependenciesByName(): List { - return listOf("com.mogo.launcher.stageone.ARouterStartUp", "com.mogo.launcher.stageone.ThreadOptStartup") + return listOf("com.mogo.launcher.stageone.ARouterStartUp","com.mogo.launcher.stageone.ConfigStartUp") } } \ No newline at end of file diff --git a/app/src/main/java/com/mogo/launcher/stageone/ConfigStartUp.kt b/app/src/main/java/com/mogo/launcher/stageone/ConfigStartUp.kt index 2350e3440c..82ac67ce34 100644 --- a/app/src/main/java/com/mogo/launcher/stageone/ConfigStartUp.kt +++ b/app/src/main/java/com/mogo/launcher/stageone/ConfigStartUp.kt @@ -105,13 +105,8 @@ class ConfigStartUp : AndroidStartup() { if (AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode)) { if (AppIdentityModeUtils.isBus(FunctionBuildConfig.appIdentityMode)) { - //是否显示 限速UI - HmiBuildConfig.isShowLimitingVelocityView = false //白天模式 FunctionBuildConfig.skinMode = 1 - } else if (AppIdentityModeUtils.isTaxi(FunctionBuildConfig.appIdentityMode)) { - //是否显示 限速UI - HmiBuildConfig.isShowLimitingVelocityView = false } } @@ -154,7 +149,4 @@ class ConfigStartUp : AndroidStartup() { } - override fun dependenciesByName(): List { - return listOf("com.mogo.launcher.stageone.ThreadOptStartup") - } } \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/speedlimit/SpeedLimitDataManager.java b/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/speedlimit/SpeedLimitDataManager.java index c3e3ffedb3..385cfb841e 100644 --- a/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/speedlimit/SpeedLimitDataManager.java +++ b/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/speedlimit/SpeedLimitDataManager.java @@ -1,6 +1,5 @@ package com.mogo.eagle.function.biz.v2x.speedlimit; -import static com.mogo.eagle.core.data.config.HmiBuildConfig.isShowObuLimitSpeedView; import static com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig.BIZ_SLW; import static com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig.V2I; @@ -8,9 +7,8 @@ import androidx.annotation.Nullable; import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationGCJ02Listener; import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ20ListenerManager; -import com.mogo.eagle.core.function.call.hmi.CallerHmiManager; import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager; -import com.mogo.eagle.core.function.call.v2x.CallLimitingVelocityListenerManager; +import com.mogo.eagle.core.function.call.v2x.CallerLimitingVelocityListenerManager; import com.mogo.eagle.core.utilcode.util.UiThreadHandler; import com.zhjt.service_biz.BizConfig; @@ -66,7 +64,7 @@ public class SpeedLimitDataManager implements IMoGoChassisLocationGCJ02Listener UiThreadHandler.post(() -> { if (speedLimit > 0) { // CallerHmiManager.INSTANCE.showLimitingVelocity(speedLimit, 1); - CallLimitingVelocityListenerManager.INSTANCE.invokeOnLimitingVelocityChange(speedLimit); + CallerLimitingVelocityListenerManager.INSTANCE.invokeOnLimitingVelocityChange(speedLimit); } }); diff --git a/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/speedlimit/SpeedLimitDispatcher.kt b/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/speedlimit/SpeedLimitDispatcher.kt index c236c2ed0e..47e491ac75 100644 --- a/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/speedlimit/SpeedLimitDispatcher.kt +++ b/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/speedlimit/SpeedLimitDispatcher.kt @@ -1,20 +1,19 @@ package com.mogo.eagle.function.biz.v2x.speedlimit import android.content.Context -import com.mogo.eagle.core.function.api.v2x.LimitingVelocityListener -import com.mogo.eagle.core.function.api.v2x.ObuLimitingSpeedListener -import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotIdentifyListenerManager -import com.mogo.eagle.core.function.call.hmi.CallerHmiManager -import com.mogo.eagle.core.function.call.trafficlight.CallerTrafficLightListenerManager -import com.mogo.eagle.core.function.call.v2x.CallLimitingVelocityListenerManager -import com.mogo.eagle.core.function.call.v2x.CallObuLimitingSpeedListenerManager +import com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig +import com.mogo.eagle.core.data.enums.DataSourceType +import com.mogo.eagle.core.function.api.v2x.ILimitingVelocityListener +import com.mogo.eagle.core.function.call.v2x.CallerLimitingVelocityListenerManager +import com.mogo.eagle.core.function.call.v2x.CallerViewLimitingVelocityListenerManager +import com.zhjt.service_biz.BizConfig /** * @author lixiaopeng * @description 对多个限速进行调度(map,rsu ...) * @since: 2023/1/12 */ -class SpeedLimitDispatcher : LimitingVelocityListener, ObuLimitingSpeedListener { +class SpeedLimitDispatcher : ILimitingVelocityListener { companion object { const val TAG = "SpeedLimitDispatcher" val INSTANCE: SpeedLimitDispatcher by lazy(mode = LazyThreadSafetyMode.SYNCHRONIZED) { @@ -24,47 +23,42 @@ class SpeedLimitDispatcher : LimitingVelocityListener, ObuLimitingSpeedListener private var mContext: Context? = null - //是否有AI获取红绿灯灯态 + //obu限速状态 private var hasObuStatus: Boolean = false - fun initLimit(context: Context) { mContext = context - //注册监听MAP的限速 - CallLimitingVelocityListenerManager.addListener(TAG, this) - //注册监听OBU的限速 - CallObuLimitingSpeedListenerManager.addListener(TAG, this) + CallerLimitingVelocityListenerManager.addListener(TAG, this) } /** * 地图限速数据 */ - override fun onLimitingVelocityChange(limitingVelocity: Int) { -// CallerHmiManager.disableLimitingVelocity() - if (!hasObuStatus) { - CallerHmiManager.showLimitingVelocity(limitingVelocity, 1) - } - } - - /** - * obu限速 - */ - override fun onObuLimitingSpeedChange(limitingSpeed: Int) { -// CallerHmiManager.disableLimitingVelocity() - if (limitingSpeed > 0) { - hasObuStatus = true - CallerHmiManager.showLimitingVelocity(limitingSpeed, 2) - } else { - hasObuStatus = false - CallerHmiManager.disableLimitingVelocity() + @BizConfig(FuncBizConfig.V2I, "", FuncBizConfig.BIZ_SLW) + override fun onLimitingVelocityChange(limitingVelocity: Int, sourceType: DataSourceType) { + when (sourceType) { // obu 优先级高于 map,体现链路能力 + DataSourceType.OBU -> { + hasObuStatus = limitingVelocity > 0 + CallerViewLimitingVelocityListenerManager.invokeOnLimitingVelocityChange( + limitingVelocity, + sourceType + ) + return + } + DataSourceType.MAP -> { + if (!hasObuStatus) { + CallerViewLimitingVelocityListenerManager.invokeOnLimitingVelocityChange( + limitingVelocity, + sourceType + ) + } + } + else -> {} } } fun destroy() { - //取消注册监听AI云获取红绿灯状态 - CallerTrafficLightListenerManager.removeListener(TAG) - //取消注册监听工控机感知红绿灯 - CallerAutopilotIdentifyListenerManager.removeListener(TAG) + CallerLimitingVelocityListenerManager.removeListener(TAG) } } \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/obu/MogoObuDcCombineManager.kt b/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/obu/MogoObuDcCombineManager.kt index 8950dd989b..27b38679d6 100644 --- a/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/obu/MogoObuDcCombineManager.kt +++ b/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/obu/MogoObuDcCombineManager.kt @@ -4,7 +4,7 @@ import android.content.Context import com.mogo.eagle.core.data.config.HmiBuildConfig import com.mogo.eagle.core.data.enums.EventTypeEnumNew import com.mogo.eagle.core.data.enums.WarningDirectionEnum -import com.mogo.eagle.core.data.msgbox.DataSourceType +import com.mogo.eagle.core.data.enums.DataSourceType import com.mogo.eagle.core.data.msgbox.MsgBoxBean import com.mogo.eagle.core.data.msgbox.MsgBoxType import com.mogo.eagle.core.data.msgbox.V2XMsg @@ -14,11 +14,13 @@ import com.mogo.eagle.core.function.call.hmi.CallerHmiManager import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxManager import com.mogo.eagle.core.function.call.obucombine.CallerObuDcCombineListenerManager +import com.mogo.eagle.core.function.call.v2x.CallerLimitingVelocityListenerManager import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_OBU import com.mogo.support.obu.constants.MogoObuConstants import mogo.v2x.ObuWarningEvent import mogo.v2x.ObuWarningEvent.* +import kotlin.math.roundToInt /** @@ -441,14 +443,15 @@ class MogoObuDcCombineManager private constructor() : IMoGoObuDcCombineListener "MogoObuDcCombineManager onMogoObuMapMath = ${data.status} --speedMaxLimit = ${Math.round((data.speedMaxLimit*0.02*3.6))} --- data.speedMaxLimit = ${data.speedMaxLimit}") when (data.status) { MogoObuConstants.STATUS.ADD -> { // 添加 TODO - CallerHmiManager.showLimitingVelocity(Math.round((data.speedMaxLimit*0.02*3.6)).toInt(), 2) + CallerLimitingVelocityListenerManager.invokeOnLimitingVelocityChange( + (data.speedMaxLimit * 0.02 * 3.6).roundToInt().toInt(),DataSourceType.OBU) } MogoObuConstants.STATUS.UPDATE -> { // 更新 } MogoObuConstants.STATUS.DELETE -> { // 删除 - CallerHmiManager.disableLimitingVelocity() + CallerLimitingVelocityListenerManager.invokeOnLimitingVelocityChange(-1 ,DataSourceType.OBU) } } } diff --git a/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/obu/MogoPrivateObuNewManager.kt b/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/obu/MogoPrivateObuNewManager.kt index ed185ab548..c06aacde0b 100644 --- a/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/obu/MogoPrivateObuNewManager.kt +++ b/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/obu/MogoPrivateObuNewManager.kt @@ -4,7 +4,6 @@ import android.content.Context import com.mogo.eagle.core.data.config.FunctionBuildConfig import com.mogo.eagle.core.data.config.HmiBuildConfig import com.mogo.eagle.core.data.enums.* -import com.mogo.eagle.core.data.msgbox.DataSourceType import com.mogo.eagle.core.data.msgbox.MsgBoxBean import com.mogo.eagle.core.data.msgbox.MsgBoxType import com.mogo.eagle.core.data.msgbox.V2XMsg @@ -18,8 +17,8 @@ import com.mogo.eagle.core.function.call.map.CallerVisualAngleManager.Scene.TooC import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxManager import com.mogo.eagle.core.function.call.obu.CallerObuListenerManager import com.mogo.eagle.core.function.call.obu.CallerObuTrafficLightListenerManager -import com.mogo.eagle.core.function.call.v2x.CallObuLimitingSpeedListenerManager -import com.mogo.eagle.core.function.datacenter.obu.utils.TrafficDataConvertUtilsNew +import com.mogo.eagle.core.function.call.v2x.CallerLimitingVelocityListenerManager +import com.mogo.eagle.core.function.obu.mogo.utils.TrafficDataConvertUtilsNew import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_OBU import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr @@ -34,6 +33,7 @@ import com.mogo.support.obu.model.advance.SpatLight import com.mogo.support.obu.option.MogoObuCom import com.mogo.support.obu.option.MogoObuOptions import org.json.JSONObject +import kotlin.math.roundToInt /** * @@ -510,7 +510,9 @@ class MogoPrivateObuNewManager private constructor() { //物体数据绘制 CallerLogger.d( - "$M_OBU${MogoObuConst.TAG_MOGO_NEW_OBU}", "onMogoObuRsmWarning ---- data.status = ${data.status} ---data.participant.ptcId = ${data.participant.ptcId} ---data.participant.ptcType = ${data.participant.ptcType} ---data.warningMsg = ${data.warningMsg} -----data = ${data.toString()}") + "$M_OBU${MogoObuConst.TAG_MOGO_NEW_OBU}", + "onMogoObuRsmWarning ---- data.status = ${data.status} ---data.participant.ptcId = ${data.participant.ptcId} ---data.participant.ptcType = ${data.participant.ptcType} ---data.warningMsg = ${data.warningMsg} -----data = ${data.toString()}" + ) when (data.status) { MogoObuConstants.STATUS.ADD -> { // 添加 // 更新数据,模型变色的时候是不是update,如果不是更新,可能导致模型不变色,(add的时候,是否有level高的) TODO @@ -550,7 +552,7 @@ class MogoPrivateObuNewManager private constructor() { //删除弱势交通元素 CallerMapUIServiceManager.getMarkerService() ?.removeCvxRvInfoIndInfo(data.participant.ptcId.toString()) - } + } } //预警status @@ -627,347 +629,421 @@ class MogoPrivateObuNewManager private constructor() { */ override fun onMogoObuMapMath(data: MogoObuMapMathData?) { super.onMogoObuMapMath(data) -// if (isShowObuLimitSpeedView) { - if (data != null) { - CallerLogger.d( - "$M_OBU${MogoObuConst.TAG_MOGO_NEW_OBU}", - "onMogoObuMapMath = ${data.status} --speedMaxLimit = ${Math.round((data.speedMaxLimit * 3.6))}" - ) - when (data.status) { - MogoObuConstants.STATUS.ADD -> { // 添加 - UiThreadHandler.post { - if (data.speedMaxLimit > 0) { -// CallerHmiManager.showLimitingVelocity( -// Math.round((data.speedMaxLimit * 3.6)).toInt(), 2) - CallObuLimitingSpeedListenerManager.invokeOnObuLimitingSpeedChange(Math.round((data.speedMaxLimit * 3.6)).toInt()) - } - } - } - - MogoObuConstants.STATUS.UPDATE -> { // 更新 - } - - MogoObuConstants.STATUS.DELETE -> { // 删除 - UiThreadHandler.post { -// CallerHmiManager.disableLimitingVelocity() - CallObuLimitingSpeedListenerManager.invokeOnObuLimitingSpeedChange(-1) + if (data != null) { + CallerLogger.d( + "$M_OBU${MogoObuConst.TAG_MOGO_NEW_OBU}", + "onMogoObuMapMath = ${data.status} --speedMaxLimit = ${(data.speedMaxLimit * 3.6).roundToInt()}" + ) + when (data.status) { + MogoObuConstants.STATUS.ADD -> { // 添加 + UiThreadHandler.post { + if (data.speedMaxLimit > 0) { + CallerLimitingVelocityListenerManager.invokeOnLimitingVelocityChange( + (data.speedMaxLimit * 3.6).roundToInt(), DataSourceType.OBU + ) } } } + + MogoObuConstants.STATUS.UPDATE -> { // 更新 + } + + MogoObuConstants.STATUS.DELETE -> { // 删除 + UiThreadHandler.post { + CallerLimitingVelocityListenerManager.invokeOnLimitingVelocityChange(-1,DataSourceType.OBU) + } + } } -// } + } } } } - /** - * 获取消息的方位 车辆相关 - */ - private fun getMessageDirection(targetClassification: Int): WarningDirectionEnum { +/** + * 获取消息的方位 车辆相关 + */ +private fun getMessageDirection(targetClassification: Int): WarningDirectionEnum { // CallerLogger.d("$M_OBU${TAG_MOGO_NEW_OBU}", "预警红边:预警方向->$targetClassification") - return when (targetClassification) { - MogoObuConstants.VEH_TARGET_POSITION.AHEAD_IN_LANE, - MogoObuConstants.VEH_TARGET_POSITION.ONCOMING_IN_LANE -> WarningDirectionEnum.ALERT_WARNING_TOP //正前方 + return when (targetClassification) { + MogoObuConstants.VEH_TARGET_POSITION.AHEAD_IN_LANE, + MogoObuConstants.VEH_TARGET_POSITION.ONCOMING_IN_LANE -> WarningDirectionEnum.ALERT_WARNING_TOP //正前方 - MogoObuConstants.VEH_TARGET_POSITION.BEHEAD_IN_LANE -> WarningDirectionEnum.ALERT_WARNING_BOTTOM //正后方 + MogoObuConstants.VEH_TARGET_POSITION.BEHEAD_IN_LANE -> WarningDirectionEnum.ALERT_WARNING_BOTTOM //正后方 - MogoObuConstants.VEH_TARGET_POSITION.INTERSECTION_RIGHT -> WarningDirectionEnum.ALERT_WARNING_RIGHT //正右方 + MogoObuConstants.VEH_TARGET_POSITION.INTERSECTION_RIGHT -> WarningDirectionEnum.ALERT_WARNING_RIGHT //正右方 - MogoObuConstants.VEH_TARGET_POSITION.INTERSECTION_LEFT -> WarningDirectionEnum.ALERT_WARNING_LEFT //正左方 + MogoObuConstants.VEH_TARGET_POSITION.INTERSECTION_LEFT -> WarningDirectionEnum.ALERT_WARNING_LEFT //正左方 - MogoObuConstants.VEH_TARGET_POSITION.AHEAD_LEFT, MogoObuConstants.VEH_TARGET_POSITION.AHEAD_FAR_LEFT, - MogoObuConstants.VEH_TARGET_POSITION.ONCOMING_LEFT, MogoObuConstants.VEH_TARGET_POSITION.ONCOMING_FAR_LEFT - -> WarningDirectionEnum.ALERT_WARNING_TOP_LEFT //左前方 + MogoObuConstants.VEH_TARGET_POSITION.AHEAD_LEFT, MogoObuConstants.VEH_TARGET_POSITION.AHEAD_FAR_LEFT, + MogoObuConstants.VEH_TARGET_POSITION.ONCOMING_LEFT, MogoObuConstants.VEH_TARGET_POSITION.ONCOMING_FAR_LEFT + -> WarningDirectionEnum.ALERT_WARNING_TOP_LEFT //左前方 - MogoObuConstants.VEH_TARGET_POSITION.AHEAD_RIGHT, MogoObuConstants.VEH_TARGET_POSITION.AHEAD_FAR_RIGHT, - MogoObuConstants.VEH_TARGET_POSITION.ONCOMING_RIGHT, MogoObuConstants.VEH_TARGET_POSITION.ONCOMING_FAT_RIGHT - -> WarningDirectionEnum.ALERT_WARNING_TOP_RIGHT //右前方 + MogoObuConstants.VEH_TARGET_POSITION.AHEAD_RIGHT, MogoObuConstants.VEH_TARGET_POSITION.AHEAD_FAR_RIGHT, + MogoObuConstants.VEH_TARGET_POSITION.ONCOMING_RIGHT, MogoObuConstants.VEH_TARGET_POSITION.ONCOMING_FAT_RIGHT + -> WarningDirectionEnum.ALERT_WARNING_TOP_RIGHT //右前方 - MogoObuConstants.VEH_TARGET_POSITION.BEHEAD_LEFT, MogoObuConstants.VEH_TARGET_POSITION.BEHEAD_FAR_LEFT, - -> WarningDirectionEnum.ALERT_WARNING_BOTTOM_LEFT //左后方 + MogoObuConstants.VEH_TARGET_POSITION.BEHEAD_LEFT, MogoObuConstants.VEH_TARGET_POSITION.BEHEAD_FAR_LEFT, + -> WarningDirectionEnum.ALERT_WARNING_BOTTOM_LEFT //左后方 - MogoObuConstants.VEH_TARGET_POSITION.BEHEAD_RIGHT, MogoObuConstants.VEH_TARGET_POSITION.BEHEAD_FAR_RIGHT, - -> WarningDirectionEnum.ALERT_WARNING_BOTTOM_RIGHT //右后方 + MogoObuConstants.VEH_TARGET_POSITION.BEHEAD_RIGHT, MogoObuConstants.VEH_TARGET_POSITION.BEHEAD_FAR_RIGHT, + -> WarningDirectionEnum.ALERT_WARNING_BOTTOM_RIGHT //右后方 - MogoObuConstants.VEH_TARGET_POSITION.UNCLASSIFIED -> WarningDirectionEnum.ALERT_WARNING_NON //未知 - else -> WarningDirectionEnum.ALERT_WARNING_ALL - } + MogoObuConstants.VEH_TARGET_POSITION.UNCLASSIFIED -> WarningDirectionEnum.ALERT_WARNING_NON //未知 + else -> WarningDirectionEnum.ALERT_WARNING_ALL } +} - /** - * 构造对应展示数据和场景 根据obu的场景,add change delete确定是否展示 - * - * @param appId 使用WarningTypeEnum获取icon、提示内容、tts内容 TODO 添加事件频繁播报拦截 - * - * @see com.mogo.module.common.enums.EventTypeEnum - */ - private fun handleSdkObu( - appId: String, - direction: WarningDirectionEnum, - status: Int, - level: Int, - info: MogoObuRvWarningData - ) { - // 这里排除需要特殊定制的语音及文案外,其余的都可以使用 EventTypeEnumNew 提供的 - var alertContent: String = "" - var ttsContent: String = "" - var changeVisualAngle = false - when (appId) { - //交叉路口碰撞预警 - MogoObuConstants.V2X_WARNING_TYPE.FCW.toString() -> { - alertContent = EventTypeEnumNew.getWarningContent(EventTypeEnumNew.TYPE_USECASE_ID_FCW.poiType) - ttsContent = EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_USECASE_ID_FCW.poiType) - } +/** + * 构造对应展示数据和场景 根据obu的场景,add change delete确定是否展示 + * + * @param appId 使用WarningTypeEnum获取icon、提示内容、tts内容 TODO 添加事件频繁播报拦截 + * + * @see com.mogo.module.common.enums.EventTypeEnum + */ +private fun handleSdkObu( + appId: String, + direction: WarningDirectionEnum, + status: Int, + level: Int, + info: MogoObuRvWarningData +) { + // 这里排除需要特殊定制的语音及文案外,其余的都可以使用 EventTypeEnumNew 提供的 + var alertContent: String = "" + var ttsContent: String = "" + var changeVisualAngle = false + when (appId) { + //交叉路口碰撞预警 + MogoObuConstants.V2X_WARNING_TYPE.FCW.toString() -> { + alertContent = + EventTypeEnumNew.getWarningContent(EventTypeEnumNew.TYPE_USECASE_ID_FCW.poiType) + ttsContent = + EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_USECASE_ID_FCW.poiType) + } - //交叉路口碰撞预警 - MogoObuConstants.V2X_WARNING_TYPE.ICW.toString() -> { - alertContent = EventTypeEnumNew.getWarningContent(EventTypeEnumNew.TYPE_USECASE_ID_ICW.poiType) - ttsContent = EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_USECASE_ID_ICW.poiType) - } + //交叉路口碰撞预警 + MogoObuConstants.V2X_WARNING_TYPE.ICW.toString() -> { + alertContent = + EventTypeEnumNew.getWarningContent(EventTypeEnumNew.TYPE_USECASE_ID_ICW.poiType) + ttsContent = + EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_USECASE_ID_ICW.poiType) + } - //左转辅助预警 - MogoObuConstants.V2X_WARNING_TYPE.LTA.toString() -> { - alertContent = EventTypeEnumNew.getWarningContent(EventTypeEnumNew.TYPE_USECASE_ID_LTA.poiType) - ttsContent = EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_USECASE_ID_LTA.poiType) - } + //左转辅助预警 + MogoObuConstants.V2X_WARNING_TYPE.LTA.toString() -> { + alertContent = + EventTypeEnumNew.getWarningContent(EventTypeEnumNew.TYPE_USECASE_ID_LTA.poiType) + ttsContent = + EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_USECASE_ID_LTA.poiType) + } - //盲区预警 - MogoObuConstants.V2X_WARNING_TYPE.BSW.toString() -> { - ttsContent = EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_USECASE_ID_BSW.poiType) - alertContent = EventTypeEnumNew.getWarningContent(EventTypeEnumNew.TYPE_USECASE_ID_BSW.poiType) - if ( - direction == WarningDirectionEnum.ALERT_WARNING_LEFT || - direction == WarningDirectionEnum.ALERT_WARNING_TOP_LEFT || - direction == WarningDirectionEnum.ALERT_WARNING_BOTTOM_LEFT - ) { //左后 - changeVisualAngle = true - ttsContent = String.format(ttsContent, "左") - alertContent = String.format(alertContent, "左") - } else if ( - direction == WarningDirectionEnum.ALERT_WARNING_RIGHT || - direction == WarningDirectionEnum.ALERT_WARNING_TOP_RIGHT || - direction == WarningDirectionEnum.ALERT_WARNING_BOTTOM_RIGHT - ) { //右后 - changeVisualAngle = true - ttsContent = String.format(ttsContent, "右") - alertContent = String.format(alertContent, "右") - } + //盲区预警 + MogoObuConstants.V2X_WARNING_TYPE.BSW.toString() -> { + ttsContent = + EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_USECASE_ID_BSW.poiType) + alertContent = + EventTypeEnumNew.getWarningContent(EventTypeEnumNew.TYPE_USECASE_ID_BSW.poiType) + if ( + direction == WarningDirectionEnum.ALERT_WARNING_LEFT || + direction == WarningDirectionEnum.ALERT_WARNING_TOP_LEFT || + direction == WarningDirectionEnum.ALERT_WARNING_BOTTOM_LEFT + ) { //左后 + changeVisualAngle = true + ttsContent = String.format(ttsContent, "左") + alertContent = String.format(alertContent, "左") + } else if ( + direction == WarningDirectionEnum.ALERT_WARNING_RIGHT || + direction == WarningDirectionEnum.ALERT_WARNING_TOP_RIGHT || + direction == WarningDirectionEnum.ALERT_WARNING_BOTTOM_RIGHT + ) { //右后 + changeVisualAngle = true + ttsContent = String.format(ttsContent, "右") + alertContent = String.format(alertContent, "右") } + } - // 变道预警,注意左后车辆/注意右后车辆 - MogoObuConstants.V2X_WARNING_TYPE.LCW.toString() -> { - alertContent = EventTypeEnumNew.getWarningContent(EventTypeEnumNew.TYPE_USECASE_ID_LCW.poiType) - ttsContent = EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_USECASE_ID_LCW.poiType) - if ( - direction == WarningDirectionEnum.ALERT_WARNING_LEFT || - direction == WarningDirectionEnum.ALERT_WARNING_TOP_LEFT || - direction == WarningDirectionEnum.ALERT_WARNING_BOTTOM_LEFT - ) { - ttsContent = String.format(ttsContent, "左") - alertContent = String.format(alertContent, "左") - } else if ( - direction == WarningDirectionEnum.ALERT_WARNING_RIGHT || - direction == WarningDirectionEnum.ALERT_WARNING_TOP_RIGHT || - direction == WarningDirectionEnum.ALERT_WARNING_BOTTOM_RIGHT - ) { - ttsContent = String.format(ttsContent, "右") - alertContent = String.format(alertContent, "右") - } + // 变道预警,注意左后车辆/注意右后车辆 + MogoObuConstants.V2X_WARNING_TYPE.LCW.toString() -> { + alertContent = + EventTypeEnumNew.getWarningContent(EventTypeEnumNew.TYPE_USECASE_ID_LCW.poiType) + ttsContent = + EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_USECASE_ID_LCW.poiType) + if ( + direction == WarningDirectionEnum.ALERT_WARNING_LEFT || + direction == WarningDirectionEnum.ALERT_WARNING_TOP_LEFT || + direction == WarningDirectionEnum.ALERT_WARNING_BOTTOM_LEFT + ) { + ttsContent = String.format(ttsContent, "左") + alertContent = String.format(alertContent, "左") + } else if ( + direction == WarningDirectionEnum.ALERT_WARNING_RIGHT || + direction == WarningDirectionEnum.ALERT_WARNING_TOP_RIGHT || + direction == WarningDirectionEnum.ALERT_WARNING_BOTTOM_RIGHT + ) { + ttsContent = String.format(ttsContent, "右") + alertContent = String.format(alertContent, "右") } + } - //逆向超车预警 - MogoObuConstants.V2X_WARNING_TYPE.DNPW.toString() -> { - alertContent = EventTypeEnumNew.getWarningContent(EventTypeEnumNew.TYPE_USECASE_ID_DNPW.poiType) - ttsContent = EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_USECASE_ID_DNPW.poiType) - } + //逆向超车预警 + MogoObuConstants.V2X_WARNING_TYPE.DNPW.toString() -> { + alertContent = + EventTypeEnumNew.getWarningContent(EventTypeEnumNew.TYPE_USECASE_ID_DNPW.poiType) + ttsContent = + EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_USECASE_ID_DNPW.poiType) + } - //紧急制动预警 - MogoObuConstants.V2X_WARNING_TYPE.EBW.toString() -> { - alertContent = EventTypeEnumNew.getWarningContent(EventTypeEnumNew.TYPE_USECASE_ID_EBW.poiType) - ttsContent = EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_USECASE_ID_EBW.poiType) - } + //紧急制动预警 + MogoObuConstants.V2X_WARNING_TYPE.EBW.toString() -> { + alertContent = + EventTypeEnumNew.getWarningContent(EventTypeEnumNew.TYPE_USECASE_ID_EBW.poiType) + ttsContent = + EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_USECASE_ID_EBW.poiType) + } - //异常车辆提醒 - MogoObuConstants.V2X_WARNING_TYPE.AVW.toString() -> { - alertContent = EventTypeEnumNew.getWarningContent(EventTypeEnumNew.TYPE_USECASE_ID_AVW.poiType) - ttsContent = EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_USECASE_ID_AVW.poiType) - alertContent = String.format(alertContent, direction.desc) - ttsContent = String.format(ttsContent, direction.desc) - } + //异常车辆提醒 + MogoObuConstants.V2X_WARNING_TYPE.AVW.toString() -> { + alertContent = + EventTypeEnumNew.getWarningContent(EventTypeEnumNew.TYPE_USECASE_ID_AVW.poiType) + ttsContent = + EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_USECASE_ID_AVW.poiType) + alertContent = String.format(alertContent, direction.desc) + ttsContent = String.format(ttsContent, direction.desc) + } - //车辆失控预警 - MogoObuConstants.V2X_WARNING_TYPE.CLW.toString() -> { - alertContent = EventTypeEnumNew.getWarningContent(EventTypeEnumNew.TYPE_USECASE_ID_CLW.poiType) - ttsContent = EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_USECASE_ID_CLW.poiType) - alertContent = String.format(alertContent, direction.desc) - ttsContent = String.format(ttsContent, direction.desc) - } - //车辆失控预警 - MogoObuConstants.V2X_WARNING_TYPE.EVW.toString() -> { - alertContent = EventTypeEnumNew.getWarningContent(EventTypeEnumNew.TYPE_USECASE_ID_EVW.poiType) - ttsContent = EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_USECASE_ID_EVW.poiType) - } + //车辆失控预警 + MogoObuConstants.V2X_WARNING_TYPE.CLW.toString() -> { + alertContent = + EventTypeEnumNew.getWarningContent(EventTypeEnumNew.TYPE_USECASE_ID_CLW.poiType) + ttsContent = + EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_USECASE_ID_CLW.poiType) + alertContent = String.format(alertContent, direction.desc) + ttsContent = String.format(ttsContent, direction.desc) + } + //车辆失控预警 + MogoObuConstants.V2X_WARNING_TYPE.EVW.toString() -> { + alertContent = + EventTypeEnumNew.getWarningContent(EventTypeEnumNew.TYPE_USECASE_ID_EVW.poiType) + ttsContent = + EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_USECASE_ID_EVW.poiType) + } - // 这里处理固定的提示信息,包括了<紧急车辆提醒> - else -> { //TODO + // 这里处理固定的提示信息,包括了<紧急车辆提醒> + else -> { //TODO // ttsContent = EventTypeEnumNew.getWarningTts(appId.toString()) // alertContent = EventTypeEnumNew.getWarningContent(appId.toString()) - } - } - - when (status) { - // 添加,更新 add的时候,可能级别是2, - MogoObuConstants.STATUS.ADD, - MogoObuConstants.STATUS.UPDATE -> { - CallerLogger.d( - "$M_OBU${MogoObuConst.TAG_MOGO_NEW_OBU}", - "new handleSdkObu appId2 = $appId --- level = $level ---ttsContent = $ttsContent --- alertContent = $alertContent --- direction = $direction" - ) - if (level == 2 || level == 3) { - //不显示弹框,其它保留 - CallerMsgBoxManager.saveMsgBox( - MsgBoxBean( - MsgBoxType.V2X, - V2XMsg( - appId, - alertContent, - ttsContent - ) - ).apply { - sourceType = DataSourceType.OBU - } - ) - CallerHmiManager.warningV2X( - appId, - alertContent, - ttsContent,// 只有第一次才tts,防止更新的时候不断的提醒 - (appId + direction.direction),//使用当前事件类型+方向记录tag,当发生变化的时候关闭当前弹出新的 - object : IMoGoWarningStatusListener { - override fun onShow() { - super.onShow() - if (changeVisualAngle) { - CallerVisualAngleManager.changeVisualAngle(TooClose) - } - } - - override fun onDismiss() { - // 关闭警告红边 - CallerHmiManager.showWarning(WarningDirectionEnum.ALERT_WARNING_NON) - if (changeVisualAngle) { - CallerVisualAngleManager.changeVisualAngle(Default()) - } - } - }, - true, - 5000L - ) - //显示警告红边 - CallerHmiManager.showWarning(direction) - } - //更新周边车辆进行预警颜色变换,车辆实时移动和变色 ,UUID不需要匹配了 - TrafficDataConvertUtilsNew.cvxV2vThreatIndInfo2TrafficData(info)?.let { - CallerMapUIServiceManager.getMarkerService() - ?.updateITrafficThreatLevelInfo(it) - } - } - // 删除 - MogoObuConstants.STATUS.DELETE -> { - // 关闭警告红边 - CallerHmiManager.showWarning(WarningDirectionEnum.ALERT_WARNING_NON) - // 移除顶部弹窗 - // CallerHmiManager.disableWarningV2X((appId + direction.direction)) - //更新周边车辆进行预警颜色变换,车辆实时移动和变色 - TrafficDataConvertUtilsNew.cvxV2vThreatIndInfo2TrafficData(info)?.let { - it.threatLevel = 0x01 - CallerMapUIServiceManager.getMarkerService() - ?.updateITrafficThreatLevelInfo(it) - } - } } } - /** - * 处理红绿灯 - */ - private fun handlerTrafficLight(appId: Int, status: Int, lights: List) { - CallerLogger.d( - "$M_OBU${MogoObuConst.TAG_MOGO_NEW_OBU}", - "handlerTrafficLight --- status = $status ---lights.size = ${lights.size} ---lights = $lights ---appId = $appId" - ) - when (status) { - // 添加 - MogoObuConstants.STATUS.ADD, - MogoObuConstants.STATUS.UPDATE - -> { - if (lights != null && lights.isNotEmpty()) { - changeTrafficLightStatus(appId, lights) - } + when (status) { + // 添加,更新 add的时候,可能级别是2, + MogoObuConstants.STATUS.ADD, + MogoObuConstants.STATUS.UPDATE -> { + CallerLogger.d( + "$M_OBU${MogoObuConst.TAG_MOGO_NEW_OBU}", + "new handleSdkObu appId2 = $appId --- level = $level ---ttsContent = $ttsContent --- alertContent = $alertContent --- direction = $direction" + ) + if (level == 2 || level == 3) { + //不显示弹框,其它保留 + CallerMsgBoxManager.saveMsgBox( + MsgBoxBean( + MsgBoxType.V2X, + V2XMsg( + appId, + alertContent, + ttsContent + ) + ).apply { + sourceType = DataSourceType.OBU + } + ) + CallerHmiManager.warningV2X( + appId, + alertContent, + ttsContent,// 只有第一次才tts,防止更新的时候不断的提醒 + (appId + direction.direction),//使用当前事件类型+方向记录tag,当发生变化的时候关闭当前弹出新的 + object : IMoGoWarningStatusListener { + override fun onShow() { + super.onShow() + if (changeVisualAngle) { + CallerVisualAngleManager.changeVisualAngle(TooClose) + } + } + + override fun onDismiss() { + // 关闭警告红边 + CallerHmiManager.showWarning(WarningDirectionEnum.ALERT_WARNING_NON) + if (changeVisualAngle) { + CallerVisualAngleManager.changeVisualAngle(Default()) + } + } + }, + true, + 5000L + ) + //显示警告红边 + CallerHmiManager.showWarning(direction) } - // 删除 - MogoObuConstants.STATUS.DELETE -> { - // 移除顶部弹窗 - CallerHmiManager.disableWarningTrafficLight() - CallerHmiManager.disableWarningV2X(appId.toString()) - isShowGreenWave = false - isShowRunRedLight = false - isYellowLight = false + //更新周边车辆进行预警颜色变换,车辆实时移动和变色 ,UUID不需要匹配了 + TrafficDataConvertUtilsNew.cvxV2vThreatIndInfo2TrafficData(info)?.let { + CallerMapUIServiceManager.getMarkerService() + ?.updateITrafficThreatLevelInfo(it) + } + } + // 删除 + MogoObuConstants.STATUS.DELETE -> { + // 关闭警告红边 + CallerHmiManager.showWarning(WarningDirectionEnum.ALERT_WARNING_NON) + // 移除顶部弹窗 + // CallerHmiManager.disableWarningV2X((appId + direction.direction)) + //更新周边车辆进行预警颜色变换,车辆实时移动和变色 + TrafficDataConvertUtilsNew.cvxV2vThreatIndInfo2TrafficData(info)?.let { + it.threatLevel = 0x01 + CallerMapUIServiceManager.getMarkerService() + ?.updateITrafficThreatLevelInfo(it) + } + } + } +} + +/** + * 处理红绿灯 + */ +private fun handlerTrafficLight(appId: Int, status: Int, lights: List) { + CallerLogger.d( + "$M_OBU${MogoObuConst.TAG_MOGO_NEW_OBU}", + "handlerTrafficLight --- status = $status ---lights.size = ${lights.size} ---lights = $lights ---appId = $appId" + ) + when (status) { + // 添加 + MogoObuConstants.STATUS.ADD, + MogoObuConstants.STATUS.UPDATE + -> { + if (lights != null && lights.isNotEmpty()) { + changeTrafficLightStatus(appId, lights) + } + } + // 删除 + MogoObuConstants.STATUS.DELETE -> { + // 移除顶部弹窗 + CallerHmiManager.disableWarningTrafficLight() + CallerHmiManager.disableWarningV2X(appId.toString()) + isShowGreenWave = false + isShowRunRedLight = false + isYellowLight = false // lightCountDownRed = 1 // lightCountDownGreen = 1 // lightCountDownYellow = 1 - } } } +} - private var isRedLight = false - private var isGreenLight = false - private var isYellowLight = false - private var isShowGreenWave = false - private var isShowRunRedLight = false +private var isRedLight = false +private var isGreenLight = false +private var isYellowLight = false +private var isShowGreenWave = false +private var isShowRunRedLight = false // private var lightCountDownRed : Int = 1 // private var lightCountDownGreen : Int = 1 // private var lightCountDownYellow : Int = 1 - /** - * 修改红绿灯 - */ - @Synchronized - private fun changeTrafficLightStatus( - appId: Int, - lights: List - ) { - var ttsContent = "" - var alertContent = "" - //这里需要根据真实数据确定 index 取值方式 - val currentLight = lights[0] - CallerLogger.d( - "$M_OBU${MogoObuConst.TAG_MOGO_NEW_OBU}", - "changeTrafficLightStatus currentLight = $currentLight ----currentLight.light = ${currentLight.light} ---currentLight.phase = ${currentLight.phaseId} ---appId = $appId --countDown = ${currentLight.countDown.toInt()}" - ) - // 闯红灯预警,绿波通行和闯红灯是互斥的 - when (appId) { - 0 -> {//不可用 V2I_RLVW_VIOLATION_TYPE_UNAVAILABLE 无效 +/** + * 修改红绿灯 + */ +@Synchronized +private fun changeTrafficLightStatus( + appId: Int, + lights: List +) { + var ttsContent = "" + var alertContent = "" + //这里需要根据真实数据确定 index 取值方式 + val currentLight = lights[0] + CallerLogger.d( + "$M_OBU${MogoObuConst.TAG_MOGO_NEW_OBU}", + "changeTrafficLightStatus currentLight = $currentLight ----currentLight.light = ${currentLight.light} ---currentLight.phase = ${currentLight.phaseId} ---appId = $appId --countDown = ${currentLight.countDown.toInt()}" + ) + // 闯红灯预警,绿波通行和闯红灯是互斥的 + when (appId) { + 0 -> {//不可用 V2I_RLVW_VIOLATION_TYPE_UNAVAILABLE 无效 + } + 1 -> {//闯红灯 V2I_RLVW_VIOLATION_TYPE_RUNNING_RED_LIGHT 一个红灯周期只显示一次 + if (!isShowRunRedLight) { + isShowRunRedLight = true + CallerHmiManager.disableWarningV2X(1667.toString()) + CallerLogger.d( + "$M_OBU${MogoObuConst.TAG_MOGO_NEW_OBU}", + "changeTrafficLightStatus 闯红灯 --------> " + ) + ttsContent = + EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_USECASE_ID_IVP_RED.poiType) + alertContent = + EventTypeEnumNew.getWarningContent(EventTypeEnumNew.TYPE_USECASE_ID_IVP_RED.poiType) + CallerMsgBoxManager.saveMsgBox( + MsgBoxBean( + MsgBoxType.V2X, + V2XMsg( + EventTypeEnumNew.TYPE_USECASE_ID_IVP_RED.poiType, + alertContent, + ttsContent + ) + ).apply { + sourceType = DataSourceType.OBU + } + ) + + CallerHmiManager.warningV2X( + EventTypeEnumNew.TYPE_USECASE_ID_IVP_RED.poiType, + alertContent, + ttsContent,// 只有第一次才tts,防止更新的时候不断的提醒 + EventTypeEnumNew.TYPE_USECASE_ID_IVP_RED.poiType, + null, + true, + 5000L + ) } - 1 -> {//闯红灯 V2I_RLVW_VIOLATION_TYPE_RUNNING_RED_LIGHT 一个红灯周期只显示一次 - if (!isShowRunRedLight) { - isShowRunRedLight = true - CallerHmiManager.disableWarningV2X(1667.toString()) - CallerLogger.d( - "$M_OBU${MogoObuConst.TAG_MOGO_NEW_OBU}", - "changeTrafficLightStatus 闯红灯 --------> " + } + + 2 -> { //绿波通行引导 V2I_RLVW_VIOLATION_TYPE_NO_VIOLATION 一个绿灯周期只显示一次 100m的时候 + if (!isShowGreenWave) { + isShowGreenWave = true + CallerHmiManager.disableWarningV2X(1666.toString()) + + var minSpeedTemp = Math.round(currentLight.suggestMinSpeed * 3.6) + var maxSpeedTemp = Math.round(currentLight.suggestMaxSpeed * 3.6) + if (minSpeedTemp == maxSpeedTemp) { + minSpeedTemp -= 5 + } + + val adviceSpeed = "$minSpeedTemp - $maxSpeedTemp" + val adviceSpeedTts = "$minSpeedTemp 到 $maxSpeedTemp" + +// val adviceSpeed = +// "${Math.round(currentLight.suggestMinSpeed*3.6)} - ${Math.round(currentLight.suggestMaxSpeed*3.6)}" +// val adviceSpeedTts = +// "${Math.round(currentLight.suggestMinSpeed*3.6)} 到 ${Math.round(currentLight.suggestMaxSpeed*3.6)}" + + ttsContent = + String.format( + EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_USECASE_ID_IVP_GREEN.poiType), + adviceSpeedTts ) - ttsContent = - EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_USECASE_ID_IVP_RED.poiType) - alertContent = - EventTypeEnumNew.getWarningContent(EventTypeEnumNew.TYPE_USECASE_ID_IVP_RED.poiType) + alertContent = + String.format( + EventTypeEnumNew.getWarningContent(EventTypeEnumNew.TYPE_USECASE_ID_IVP_GREEN.poiType), + adviceSpeed + ) + + val maxSpeed = currentLight.suggestMaxSpeed + if (maxSpeed > 0) { CallerMsgBoxManager.saveMsgBox( MsgBoxBean( MsgBoxType.V2X, V2XMsg( - EventTypeEnumNew.TYPE_USECASE_ID_IVP_RED.poiType, + EventTypeEnumNew.TYPE_USECASE_ID_IVP_GREEN.poiType, alertContent, ttsContent ) @@ -977,118 +1053,61 @@ class MogoPrivateObuNewManager private constructor() { ) CallerHmiManager.warningV2X( - EventTypeEnumNew.TYPE_USECASE_ID_IVP_RED.poiType, + EventTypeEnumNew.TYPE_USECASE_ID_IVP_GREEN.poiType, alertContent, ttsContent,// 只有第一次才tts,防止更新的时候不断的提醒 - EventTypeEnumNew.TYPE_USECASE_ID_IVP_RED.poiType, + appId.toString(), null, true, 5000L ) } } - - 2 -> { //绿波通行引导 V2I_RLVW_VIOLATION_TYPE_NO_VIOLATION 一个绿灯周期只显示一次 100m的时候 - if (!isShowGreenWave) { - isShowGreenWave = true - CallerHmiManager.disableWarningV2X(1666.toString()) - - var minSpeedTemp = Math.round(currentLight.suggestMinSpeed*3.6) - var maxSpeedTemp = Math.round(currentLight.suggestMaxSpeed*3.6) - if (minSpeedTemp == maxSpeedTemp) { - minSpeedTemp -= 5 - } - - val adviceSpeed = "$minSpeedTemp - $maxSpeedTemp" - val adviceSpeedTts = "$minSpeedTemp 到 $maxSpeedTemp" - -// val adviceSpeed = -// "${Math.round(currentLight.suggestMinSpeed*3.6)} - ${Math.round(currentLight.suggestMaxSpeed*3.6)}" -// val adviceSpeedTts = -// "${Math.round(currentLight.suggestMinSpeed*3.6)} 到 ${Math.round(currentLight.suggestMaxSpeed*3.6)}" - - ttsContent = - String.format( - EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_USECASE_ID_IVP_GREEN.poiType), - adviceSpeedTts - ) - alertContent = - String.format( - EventTypeEnumNew.getWarningContent(EventTypeEnumNew.TYPE_USECASE_ID_IVP_GREEN.poiType), - adviceSpeed - ) - - val maxSpeed = currentLight.suggestMaxSpeed - if (maxSpeed > 0) { - CallerMsgBoxManager.saveMsgBox( - MsgBoxBean( - MsgBoxType.V2X, - V2XMsg( - EventTypeEnumNew.TYPE_USECASE_ID_IVP_GREEN.poiType, - alertContent, - ttsContent - ) - ).apply { - sourceType = DataSourceType.OBU - } - ) - - CallerHmiManager.warningV2X( - EventTypeEnumNew.TYPE_USECASE_ID_IVP_GREEN.poiType, - alertContent, - ttsContent,// 只有第一次才tts,防止更新的时候不断的提醒 - appId.toString(), - null, - true, - 5000L - ) - } - } - } - } - - when (currentLight.light) { - // 灯光不可用 - 0 -> { - CallerObuTrafficLightListenerManager.invokeObuTrafficLight(0) - } - // 红灯 - 2, 3 -> { - if (!isRedLight) { - CallerHmiManager.disableWarningV2X(appId.toString()) - isRedLight = true - } - isGreenLight = false - isYellowLight = false - CallerObuTrafficLightListenerManager.invokeObuTrafficLight(1) - val red = currentLight.countDown.toInt() - CallerHmiManager.changeCountdownRed(red) - } - - // 绿灯 - 4, 5, 6 -> { - if (!isGreenLight) { - CallerHmiManager.disableWarningV2X(appId.toString()) - isGreenLight = true - } - isRedLight = false - isYellowLight = false - CallerObuTrafficLightListenerManager.invokeObuTrafficLight(3) - val green = currentLight.countDown.toInt() - CallerHmiManager.changeCountdownGreen(green) - } - - // 黄灯 - 7, 8 -> { - if (!isYellowLight) { - isYellowLight = true - } - isRedLight = false - isGreenLight = false - CallerHmiManager.disableWarningV2X(appId.toString()) - CallerObuTrafficLightListenerManager.invokeObuTrafficLight(2) - val yellow = currentLight.countDown.toInt() - CallerHmiManager.changeCountdownYellow(yellow) - } } } + + when (currentLight.light) { + // 灯光不可用 + 0 -> { + CallerObuTrafficLightListenerManager.invokeObuTrafficLight(0) + } + // 红灯 + 2, 3 -> { + if (!isRedLight) { + CallerHmiManager.disableWarningV2X(appId.toString()) + isRedLight = true + } + isGreenLight = false + isYellowLight = false + CallerObuTrafficLightListenerManager.invokeObuTrafficLight(1) + val red = currentLight.countDown.toInt() + CallerHmiManager.changeCountdownRed(red) + } + + // 绿灯 + 4, 5, 6 -> { + if (!isGreenLight) { + CallerHmiManager.disableWarningV2X(appId.toString()) + isGreenLight = true + } + isRedLight = false + isYellowLight = false + CallerObuTrafficLightListenerManager.invokeObuTrafficLight(3) + val green = currentLight.countDown.toInt() + CallerHmiManager.changeCountdownGreen(green) + } + + // 黄灯 + 7, 8 -> { + if (!isYellowLight) { + isYellowLight = true + } + isRedLight = false + isGreenLight = false + CallerHmiManager.disableWarningV2X(appId.toString()) + CallerObuTrafficLightListenerManager.invokeObuTrafficLight(2) + val yellow = currentLight.countDown.toInt() + CallerHmiManager.changeCountdownYellow(yellow) + } + } +} diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/receiver/V2XLimitingVelocityBroadcastReceiver.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/receiver/V2XLimitingVelocityBroadcastReceiver.kt index 1395d3578f..5c2a231c3d 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/receiver/V2XLimitingVelocityBroadcastReceiver.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/receiver/V2XLimitingVelocityBroadcastReceiver.kt @@ -3,7 +3,11 @@ package com.mogo.eagle.core.function.hmi.receiver import android.content.BroadcastReceiver import android.content.Context import android.content.Intent -import com.mogo.eagle.core.function.call.hmi.CallerHmiManager +import android.view.View +import com.mogo.eagle.core.data.enums.DataSourceType +import com.mogo.eagle.core.function.api.hmi.view.IViewControlListener.Companion.LimitingVelocityView_TAG +import com.mogo.eagle.core.function.call.hmi.CallerHmiViewControlListenerManager +import com.mogo.eagle.core.function.call.v2x.CallerViewLimitingVelocityListenerManager import com.mogo.eagle.core.function.hmi.WaringConst import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_HMI @@ -57,13 +61,13 @@ class V2XLimitingVelocityBroadcastReceiver : BroadcastReceiver() { * @param limitingVelocitySpeed 限速速度 */ private fun dispatchShowWaring(limitingVelocitySpeed: Int) { - CallerHmiManager.showLimitingVelocity(limitingVelocitySpeed, 1) + CallerViewLimitingVelocityListenerManager.invokeOnLimitingVelocityChange(limitingVelocitySpeed,DataSourceType.MAP) } /** * 关闭限速标志 */ private fun dispatchCloseWaring() { - CallerHmiManager.disableLimitingVelocity() + CallerHmiViewControlListenerManager.invokeVisible(LimitingVelocityView_TAG, View.GONE) } } \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/MoGoHmiFragment.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/MoGoHmiFragment.kt index 9f482ca275..8bd6b1baef 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/MoGoHmiFragment.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/MoGoHmiFragment.kt @@ -1,7 +1,6 @@ package com.mogo.eagle.core.function.hmi.ui import android.content.Context -import android.os.Bundle import android.text.TextUtils import android.util.Log import android.view.View @@ -31,13 +30,6 @@ import com.mogo.eagle.core.data.notice.NoticeNormalData import com.mogo.eagle.core.data.notice.NoticeTrafficStylePushData import com.mogo.eagle.core.data.report.ReportEntity import com.mogo.eagle.core.function.api.hmi.IMoGoHmiViewProxy -import com.mogo.eagle.core.function.api.hmi.view.IViewControlListener.Companion.AutoPilotStatusView_TAG -import com.mogo.eagle.core.function.api.hmi.view.IViewControlListener.Companion.CameraView_TAG -import com.mogo.eagle.core.function.api.hmi.view.IViewControlListener.Companion.PerspectiveSwitchView_TAG -import com.mogo.eagle.core.function.api.hmi.view.IViewControlListener.Companion.SpeedPanelView_TAG -import com.mogo.eagle.core.function.api.hmi.view.IViewControlListener.Companion.ToolsView_TAG -import com.mogo.eagle.core.function.api.hmi.view.IViewControlListener.Companion.TrafficLightView_TAG -import com.mogo.eagle.core.function.api.hmi.view.IViewLimitingVelocity import com.mogo.eagle.core.function.api.hmi.view.IViewTrafficLight import com.mogo.eagle.core.function.api.hmi.warning.IMoGoHmiProvider import com.mogo.eagle.core.function.api.hmi.warning.IMoGoWarningStatusListener @@ -87,7 +79,7 @@ import java.util.concurrent.atomic.AtomicReference class MoGoHmiFragment : MvpFragment(), IMoGoHmiProvider, IMoGoHmiViewProxy, - MoGoHmiContract.View{ + MoGoHmiContract.View { companion object { private const val TAG = "MoGoHmiFragment" @@ -97,9 +89,6 @@ class MoGoHmiFragment : MvpFragment(), // todo 需要统一数据源 红绿灯 View代理 private var mViewTrafficLight: IViewTrafficLight? = null - // todo 需要统一数据源 限速 View代理 - private var mViewLimitingVelocity: IViewLimitingVelocity? = null - private val lastSpeakJob by lazy { AtomicReference() } private var lastShowV2XJob: Job? = null @@ -107,9 +96,6 @@ class MoGoHmiFragment : MvpFragment(), override fun initViews() { - //设置StatusBar初始状态 - CallerHmiViewControlListenerManager.updateStatusBarRightView(StatusBarView.TAG,FunctionBuildConfig.isDemoMode, "demoMode", DemoModeView(requireContext())) - //todo 新超,封装至消息盒子 cbMsgBoxDriver.setOnCheckedChangeListener { _, isChecked -> if (isChecked) { @@ -170,12 +156,6 @@ class MoGoHmiFragment : MvpFragment(), } } - override fun onViewCreated(view: View, savedInstanceState: Bundle?) { - super.onViewCreated(view, savedInstanceState) - //todo 确认使用方 taxi bus 乘客/司机 - setProxyLimitingSpeedView(viewLimitingVelocity) - } - /** todo ----------------------------------------------**/ /** * 设置 红绿灯 代理View @@ -184,13 +164,6 @@ class MoGoHmiFragment : MvpFragment(), mViewTrafficLight = view } - /** - * 设置 限速 代理View - */ - override fun setProxyLimitingSpeedView(view: IViewLimitingVelocity) { - mViewLimitingVelocity = view - } - /** * ok * 工控机重启返回结果 @@ -236,23 +209,38 @@ class MoGoHmiFragment : MvpFragment(), } override fun setStatusBarDarkOrLight(light: Boolean) { - CallerHmiViewControlListenerManager.setStatusBarDarkOrLight(StatusBarView.TAG,light) + CallerHmiViewControlListenerManager.setStatusBarDarkOrLight(StatusBarView.TAG, light) } override fun updateStatusBarRightView(insert: Boolean, tag: String, viewGroup: ViewGroup) { - CallerHmiViewControlListenerManager.updateStatusBarRightView(StatusBarView.TAG,insert, tag, viewGroup) + CallerHmiViewControlListenerManager.updateStatusBarRightView( + StatusBarView.TAG, + insert, + tag, + viewGroup + ) } override fun updateStatusBarLeftView(insert: Boolean, tag: String, viewGroup: ViewGroup) { - CallerHmiViewControlListenerManager.updateStatusBarLeftView(StatusBarView.TAG,insert, tag, viewGroup) + CallerHmiViewControlListenerManager.updateStatusBarLeftView( + StatusBarView.TAG, + insert, + tag, + viewGroup + ) } override fun updateStatusBarDownloadView(insert: Boolean, tag: String, progress: Int) { - CallerHmiViewControlListenerManager.updateStatusBarDownloadView(StatusBarView.TAG,insert, tag, progress) + CallerHmiViewControlListenerManager.updateStatusBarDownloadView( + StatusBarView.TAG, + insert, + tag, + progress + ) } override fun updateMfStatus(tag: String, status: Boolean) { - CallerHmiViewControlListenerManager.updateMfStatus(StatusBarView.TAG,tag, status) + CallerHmiViewControlListenerManager.updateMfStatus(StatusBarView.TAG, tag, status) } override fun getLayoutId(): Int { @@ -271,30 +259,6 @@ class MoGoHmiFragment : MvpFragment(), DisplayEffectsHelper.getInstance().display() } - override fun setTrafficLightVrVisibility(visibility: Int) { - CallerHmiViewControlListenerManager.invokeVisible(TrafficLightView_TAG,visibility) - } - - override fun setToolsViewVisibility(visibility: Int) { - CallerHmiViewControlListenerManager.invokeVisible(ToolsView_TAG,visibility) - } - - override fun setSpeedChartViewVisibility(visibility: Int) { - CallerHmiViewControlListenerManager.invokeVisible(SpeedPanelView_TAG,visibility) - } - - override fun setAutopilotStatusViewVisibility(visibility: Int) { - CallerHmiViewControlListenerManager.invokeVisible(AutoPilotStatusView_TAG,visibility) - } - - override fun setPerspectiveSwitchViewVisibility(visibility: Int) { - CallerHmiViewControlListenerManager.invokeVisible(PerspectiveSwitchView_TAG,visibility) - } - - override fun setCameraViewVisibility(visibility: Int) { - CallerHmiViewControlListenerManager.invokeVisible(CameraView_TAG, visibility) - } - /** todo----------------------------------------------- **/ /** * 不展示顶部弹窗,其它保留 @@ -351,7 +315,7 @@ class MoGoHmiFragment : MvpFragment(), if (ttsContent != null && !TextUtils.isEmpty(ttsContent) && playTTS) { val last = lastSpeakJob.get() Log.d("CODE", "---- 0 ------: last: $last") - if (last != null && !last.isCompleted) { + if (last != null && !last.isCompleted) { Log.d("CODE", "---- 1 ------") return } @@ -452,40 +416,6 @@ class MoGoHmiFragment : MvpFragment(), mViewTrafficLight?.changeCountdownTrafficLightNum(readNum, yellowNum, greenNum) } - /** - * 控制展示限速标志及内容 - */ - override fun showLimitingVelocity(limitingSpeed: Int, limitSpeedSource: Int) { - // 控制 限速UI 展示 - if (HmiBuildConfig.isShowLimitingVelocityView) { - if (limitingSpeed > 0) { - mViewLimitingVelocity?.visibility = View.VISIBLE - mViewLimitingVelocity?.updateLimitingSpeed(limitingSpeed, limitSpeedSource) - tvLimitingSource?.visibility = View.VISIBLE - if (limitSpeedSource == 1) { - tvLimitingSource.text = "MAP" - } else if (limitSpeedSource == 2) { - tvLimitingSource.text = "RSU" - } - } else { - mViewLimitingVelocity?.visibility = View.INVISIBLE - mViewLimitingVelocity?.updateLimitingSpeed(0, limitSpeedSource) - tvLimitingSource?.visibility = View.INVISIBLE - } - } else { - disableLimitingVelocity() - tvLimitingSource?.visibility = View.GONE - } - } - - /** - * 控制关闭限速标志及内容 - */ - override fun disableLimitingVelocity() { - mViewLimitingVelocity?.visibility = View.GONE - mViewLimitingVelocity?.updateLimitingSpeed(0, 1) - } - /** * 展示指定方位上的红框预警 * @param direction diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/DebugSettingView.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/DebugSettingView.kt index 1674acdcb5..14e6d0cee2 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/DebugSettingView.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/DebugSettingView.kt @@ -1032,49 +1032,6 @@ internal class DebugSettingView @JvmOverloads constructor( * 设置Hmi点击监听 */ private fun setHmiCheckedChangeListener() { - /** - * 显示、隐藏迈速表 - */ - tbSpeedView.setOnCheckedChangeListener { _, isChecked -> - if (!isChecked) { - CallerHmiManager.setSpeedChartViewVisibility(View.VISIBLE) - } else { - CallerHmiManager.setSpeedChartViewVisibility(View.GONE) - } - } - - /** - * 显示、隐藏“自动驾驶控制按钮” - */ - tbAutopilotStatusView.setOnCheckedChangeListener { _, isChecked -> - if (!isChecked) { - CallerHmiManager.setAutopilotStatusViewVisibility(View.VISIBLE) - } else { - CallerHmiManager.setAutopilotStatusViewVisibility(View.GONE) - } - } - - /** - * 显示、隐藏视角切换按钮 - */ - tbPerspectiveSwitchView.setOnCheckedChangeListener { _, isChecked -> - if (!isChecked) { - CallerHmiManager.setPerspectiveSwitchViewVisibility(View.VISIBLE) - } else { - CallerHmiManager.setPerspectiveSwitchViewVisibility(View.GONE) - } - } - - /** - * 显示、隐藏工具箱 - */ - tbCheckStatusView.setOnCheckedChangeListener { _, isChecked -> - if (!isChecked) { - CallerHmiManager.setToolsViewVisibility(View.VISIBLE) - } else { - CallerHmiManager.setToolsViewVisibility(View.GONE) - } - } /** * 隐藏、显示小地图 diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/SOPSettingView.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/SOPSettingView.kt index e6afb2b7b2..0ae1263047 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/SOPSettingView.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/SOPSettingView.kt @@ -10,6 +10,7 @@ import com.mogo.eagle.core.data.config.FunctionBuildConfig import com.mogo.eagle.core.data.config.HmiBuildConfig import com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig import com.mogo.eagle.core.function.api.devatools.IMoGoDevaToolsFuncConfigListener +import com.mogo.eagle.core.function.api.hmi.view.IViewControlListener import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsFuncConfigListenerManager import com.mogo.eagle.core.function.call.hmi.CallerHmiManager @@ -19,6 +20,7 @@ import com.mogo.eagle.core.utilcode.kotlin.currentPadding import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils import com.mogo.eagle.core.utilcode.util.ToastUtils import com.mogo.eagle.core.function.business.routeoverlay.RouteStrategy +import com.mogo.eagle.core.function.call.hmi.CallerHmiViewControlListenerManager import com.mogo.eagle.core.function.hmi.ui.widget.DemoModeView import com.mogo.eagle.core.utilcode.util.UiThreadHandler import kotlinx.android.synthetic.main.view_debug_setting.view.* @@ -150,7 +152,7 @@ internal class SOPSettingView @JvmOverloads constructor( HmiBuildConfig.isShowLimitingVelocityView = true } else { HmiBuildConfig.isShowLimitingVelocityView = false - CallerHmiManager.disableLimitingVelocity() + CallerHmiViewControlListenerManager.invokeVisible(IViewControlListener.LimitingVelocityView_TAG,View.GONE) } } diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/tools/ToolsImageView.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/tools/ToolsImageView.kt index 84400ca732..2e8b24e018 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/tools/ToolsImageView.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/tools/ToolsImageView.kt @@ -2,14 +2,11 @@ package com.mogo.eagle.core.function.hmi.ui.tools import android.content.Context import android.util.AttributeSet -import com.mogo.eagle.core.function.api.hmi.view.IViewControlListener -import com.mogo.eagle.core.function.api.hmi.view.IViewControlListener.Companion.ToolsView_TAG -import com.mogo.eagle.core.function.call.hmi.CallerHmiViewControlListenerManager import com.mogo.eagle.core.function.hmi.R import com.mogo.eagle.core.function.hmi.ui.setting.ToolsView.Companion.toolsView class ToolsImageView(context: Context, attrs: AttributeSet?) : - androidx.appcompat.widget.AppCompatImageView(context, attrs), IViewControlListener { + androidx.appcompat.widget.AppCompatImageView(context, attrs) { override fun onAttachedToWindow() { super.onAttachedToWindow() @@ -19,17 +16,6 @@ class ToolsImageView(context: Context, attrs: AttributeSet?) : setOnClickListener{ toolsView.showToolsFloat(context) } - - CallerHmiViewControlListenerManager.addListener(ToolsView_TAG, this) } - override fun visible(v: Int) { - super.visible(v) - visibility = v - } - - override fun onDetachedFromWindow() { - super.onDetachedFromWindow() - CallerHmiViewControlListenerManager.removeListener(ToolsView_TAG) - } } \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/AutoPilotStatusView.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/AutoPilotStatusView.kt index e6c453db80..2ff479a1c7 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/AutoPilotStatusView.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/AutoPilotStatusView.kt @@ -8,14 +8,11 @@ import androidx.constraintlayout.widget.ConstraintLayout import com.mogo.eagle.core.data.autopilot.AutopilotControlParameters import com.mogo.eagle.core.data.autopilot.AutopilotStatusInfo import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener -import com.mogo.eagle.core.function.api.hmi.view.IViewControlListener -import com.mogo.eagle.core.function.api.hmi.view.IViewControlListener.Companion.AutoPilotStatusView_TAG import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager.getCurWgs84Lat import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager.getCurWgs84Lon import com.mogo.eagle.core.function.call.hmi.CallerHmiListenerManager -import com.mogo.eagle.core.function.call.hmi.CallerHmiViewControlListenerManager import com.mogo.eagle.core.function.hmi.R import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_HMI @@ -33,7 +30,7 @@ class AutoPilotStatusView constructor( attrs: AttributeSet ) : ConstraintLayout(context, attrs), View.OnClickListener, - IMoGoAutopilotStatusListener, IViewControlListener { + IMoGoAutopilotStatusListener { companion object { const val TAG = "AutopilotStatusView" @@ -57,17 +54,10 @@ class AutoPilotStatusView constructor( setOnClickListener(this) // 自动驾驶状态监听 CallerAutoPilotStatusListenerManager.addListener(TAG, this) - CallerHmiViewControlListenerManager.addListener(AutoPilotStatusView_TAG, this) - CallerLogger.d("$M_HMI$TAG", "autopilotStatus: $mAutopilotStatus") setAutoPilotStatus(mAutopilotStatus) } - override fun visible(v: Int) { - super.visible(v) - visibility = v - } - override fun onClick(v: View?) { when (mAutopilotStatus) { 0 -> {// 不可自动驾驶,adas与工控机没有链接,或工控机异常 @@ -139,7 +129,6 @@ class AutoPilotStatusView constructor( override fun onDetachedFromWindow() { super.onDetachedFromWindow() CallerAutoPilotStatusListenerManager.removeListener(TAG) - CallerHmiViewControlListenerManager.removeListener(AutoPilotStatusView_TAG) } } \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/CameraView.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/CameraView.kt index 70e5ae0f35..36337a284b 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/CameraView.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/CameraView.kt @@ -2,15 +2,12 @@ package com.mogo.eagle.core.function.hmi.ui.widget import android.content.Context import android.util.AttributeSet -import com.mogo.eagle.core.function.api.hmi.view.IViewControlListener -import com.mogo.eagle.core.function.api.hmi.view.IViewControlListener.Companion.CameraView_TAG import com.mogo.eagle.core.function.call.biz.CallerFuncBizManager -import com.mogo.eagle.core.function.call.hmi.CallerHmiViewControlListenerManager import com.mogo.eagle.core.function.hmi.R import com.mogo.eagle.core.function.hmi.ui.setting.CameraLiveView.Companion.cameraLiveView class CameraView(context: Context, attrs: AttributeSet?) : - androidx.appcompat.widget.AppCompatImageView(context, attrs), IViewControlListener { + androidx.appcompat.widget.AppCompatImageView(context, attrs) { override fun onAttachedToWindow() { super.onAttachedToWindow() @@ -28,16 +25,6 @@ class CameraView(context: Context, attrs: AttributeSet?) : } } - CallerHmiViewControlListenerManager.addListener(CameraView_TAG, this) } - override fun visible(v: Int) { - super.visible(v) - visibility = v - } - - override fun onDetachedFromWindow() { - super.onDetachedFromWindow() - CallerHmiViewControlListenerManager.removeListener(CameraView_TAG) - } } \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/LimitingVelocityView.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/LimitingVelocityView.kt index c766f7a029..6df4d6b3c2 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/LimitingVelocityView.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/LimitingVelocityView.kt @@ -3,7 +3,14 @@ package com.mogo.eagle.core.function.hmi.ui.widget import android.content.Context import android.util.AttributeSet import android.view.LayoutInflater -import com.mogo.eagle.core.function.api.hmi.view.IViewLimitingVelocity +import android.view.View +import android.widget.LinearLayout +import com.mogo.eagle.core.data.enums.DataSourceType +import com.mogo.eagle.core.function.api.hmi.view.IViewControlListener +import com.mogo.eagle.core.function.api.hmi.view.IViewControlListener.Companion.LimitingVelocityView_TAG +import com.mogo.eagle.core.function.api.v2x.ILimitingVelocityListener +import com.mogo.eagle.core.function.call.hmi.CallerHmiViewControlListenerManager +import com.mogo.eagle.core.function.call.v2x.CallerViewLimitingVelocityListenerManager import com.mogo.eagle.core.function.hmi.R import kotlinx.android.synthetic.main.view_limiting_speed_vr.view.* @@ -11,17 +18,48 @@ import kotlinx.android.synthetic.main.view_limiting_speed_vr.view.* * 限速控件 */ class LimitingVelocityView @JvmOverloads constructor( - context: Context, - attrs: AttributeSet? = null, - defStyleAttr: Int = 0 -) : IViewLimitingVelocity(context, attrs, defStyleAttr) { + context: Context, + attrs: AttributeSet? = null, + defStyleAttr: Int = 0 +) : LinearLayout(context, attrs, defStyleAttr), ILimitingVelocityListener, IViewControlListener { + + companion object { + private const val TAG = "LimitingVelocityView" + } init { LayoutInflater.from(context).inflate(R.layout.view_limiting_speed_vr, this, true) } - override fun updateLimitingSpeed(limitingSpeed: Int, limitSource: Int) { - super.updateLimitingSpeed(limitingSpeed, limitSource) - tvLimitingVelocity.text = "$limitingSpeed" + override fun onAttachedToWindow() { + super.onAttachedToWindow() + CallerViewLimitingVelocityListenerManager.addListener(TAG, this) + CallerHmiViewControlListenerManager.addListener(LimitingVelocityView_TAG, this) } + + override fun onLimitingVelocityChange(limitingVelocity: Int, sourceType: DataSourceType) { + if (limitingVelocity > 0) { + tvLimitingVelocity.visibility = View.VISIBLE + tvLimitingSource.visibility = View.VISIBLE + tvLimitingVelocity.text = "$limitingVelocity" + tvLimitingSource.text = sourceType.name + } else { + tvLimitingVelocity.visibility = View.GONE + tvLimitingSource.visibility = View.GONE + tvLimitingSource.text = "" + } + } + + override fun visible(v: Int) { + super.visible(v) + tvLimitingVelocity.visibility = v + tvLimitingSource.visibility = v + } + + override fun onDetachedFromWindow() { + super.onDetachedFromWindow() + CallerViewLimitingVelocityListenerManager.removeListener(TAG) + CallerHmiViewControlListenerManager.removeListener(LimitingVelocityView_TAG) + } + } \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/PerspectiveSwitchView.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/PerspectiveSwitchView.kt index 55e04f82ec..09cd83ed9a 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/PerspectiveSwitchView.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/PerspectiveSwitchView.kt @@ -5,9 +5,6 @@ import android.util.AttributeSet import android.view.LayoutInflater import android.view.View import android.widget.FrameLayout -import com.mogo.eagle.core.function.api.hmi.view.IViewControlListener -import com.mogo.eagle.core.function.api.hmi.view.IViewControlListener.Companion.PerspectiveSwitchView_TAG -import com.mogo.eagle.core.function.call.hmi.CallerHmiViewControlListenerManager import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager.getMapUIController import com.mogo.eagle.core.function.hmi.R import com.mogo.map.uicontroller.VisualAngleMode @@ -22,20 +19,13 @@ class PerspectiveSwitchView @JvmOverloads constructor( context: Context, attrs: AttributeSet? = null, defStyleAttr: Int = 0 -) : FrameLayout(context, attrs, defStyleAttr), View.OnClickListener, IViewControlListener{ +) : FrameLayout(context, attrs, defStyleAttr), View.OnClickListener{ override fun onAttachedToWindow() { super.onAttachedToWindow() LayoutInflater.from(context).inflate(R.layout.view_perspective_switch, this, true) setBackgroundResource(R.drawable.module_switch_map_bg) setOnClickListener(this) - - CallerHmiViewControlListenerManager.addListener(PerspectiveSwitchView_TAG,this) - } - - override fun visible(v: Int) { - super.visible(v) - visibility = v } override fun onClick(v: View?) { @@ -53,9 +43,4 @@ class PerspectiveSwitchView @JvmOverloads constructor( } } - override fun onDetachedFromWindow() { - super.onDetachedFromWindow() - CallerHmiViewControlListenerManager.removeListener(PerspectiveSwitchView_TAG) - } - } \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/SpeedPanelView.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/SpeedPanelView.kt index 46dda6467e..17b6cd5978 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/SpeedPanelView.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/SpeedPanelView.kt @@ -6,11 +6,7 @@ import android.util.AttributeSet import android.view.Gravity import android.widget.FrameLayout import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationGCJ02Listener -import com.mogo.eagle.core.function.api.hmi.view.IViewControlListener -import com.mogo.eagle.core.function.api.hmi.view.IViewControlListener.Companion.SpeedPanelView_TAG import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ20ListenerManager -import com.mogo.eagle.core.function.call.hmi.CallerHmiManager -import com.mogo.eagle.core.function.call.hmi.CallerHmiViewControlListenerManager import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager import com.mogo.eagle.core.function.hmi.R import com.mogo.eagle.core.utilcode.util.UiThreadHandler @@ -25,7 +21,7 @@ class SpeedPanelView @JvmOverloads constructor( context: Context, attrs: AttributeSet? = null, defStyleAttr: Int = 0 -) : FrameLayout(context, attrs, defStyleAttr), IMoGoChassisLocationGCJ02Listener,IViewControlListener { +) : FrameLayout(context, attrs, defStyleAttr), IMoGoChassisLocationGCJ02Listener { companion object { const val TAG = "SpeedPanelView" @@ -58,8 +54,6 @@ class SpeedPanelView @JvmOverloads constructor( override fun onAttachedToWindow() { super.onAttachedToWindow() - // 注册view控制显示隐藏监听 - CallerHmiViewControlListenerManager.addListener(SpeedPanelView_TAG,this) // 注册位置回调 CallerChassisLocationGCJ20ListenerManager.addListener(TAG, this) // 开启定时查询速度 @@ -89,15 +83,9 @@ class SpeedPanelView @JvmOverloads constructor( } } - override fun visible(v: Int) { - super.visible(v) - visibility = v - } - override fun onDetachedFromWindow() { super.onDetachedFromWindow() // 解除注册 - CallerHmiViewControlListenerManager.removeListener(SpeedPanelView_TAG) CallerChassisLocationGCJ20ListenerManager.removeListener(TAG) try { timerTask?.cancel() diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/StatusBarView.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/StatusBarView.kt index 42079aa30b..3aad68006d 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/StatusBarView.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/StatusBarView.kt @@ -6,6 +6,7 @@ import android.util.AttributeSet import android.view.LayoutInflater import android.view.ViewGroup import android.widget.LinearLayout +import com.mogo.eagle.core.data.config.FunctionBuildConfig import com.mogo.eagle.core.data.mofang.MfConstants import com.mogo.eagle.core.function.api.hmi.view.IViewControlListener import com.mogo.eagle.core.function.api.setting.IMoGoSkinModeChangeListener @@ -51,6 +52,7 @@ class StatusBarView @JvmOverloads constructor( //将状态窗口中的状态移到状态栏上 CallerDevaToolsManager.showStatusBar(context, status_container) + updateStatusBarRightView(FunctionBuildConfig.isDemoMode, "demoMode", DemoModeView(this.context)) } override fun onSkinModeChange(skinMode: Int) { diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/VipIdentificationView.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/VipIdentificationView.kt index d9dd3ee643..47054ca428 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/VipIdentificationView.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/VipIdentificationView.kt @@ -27,32 +27,14 @@ class VipIdentificationView : ConstraintLayout, IMoGoVipSetListener { attributeSet, defStyleAttr ) { - init(attributeSet, defStyleAttr) } - private var marginStart: Float = 0.0f - private var marginTop: Float = 0.0f - - private fun init(attrs: AttributeSet, defStyleAttr: Int) { + init { LayoutInflater.from(context).inflate(R.layout.view_vip_identification, this, true) - val a = context.obtainStyledAttributes( - attrs, - R.styleable.VipIdentificationView, - defStyleAttr, - 0 - ) - marginStart = a.getDimension(R.styleable.VipIdentificationView_marginStart, 0.0f) - marginTop = a.getDimension(R.styleable.VipIdentificationView_marginTop, 0.0f) - a.recycle() } override fun onAttachedToWindow() { super.onAttachedToWindow() - val lp = this.layoutParams as LayoutParams - lp.marginStart = marginStart.toInt() - lp.topMargin = marginTop.toInt() - this.layoutParams = lp - invalidate() CallVipSetListenerManager.addListener(TAG, this) } diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/fragment_hmi.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/fragment_hmi.xml index b2dd4a6f0a..56b54cc6dd 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/fragment_hmi.xml +++ b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/fragment_hmi.xml @@ -20,45 +20,6 @@ android:layout_width="match_parent" android:layout_height="match_parent" android:paddingTop="72dp"> - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_debug_setting.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_debug_setting.xml index d3969d4863..639cc50149 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_debug_setting.xml +++ b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_debug_setting.xml @@ -1274,54 +1274,6 @@ app:layout_constraintLeft_toRightOf="@+id/tbChangeCurrentCarIcon" app:layout_constraintTop_toTopOf="@id/tbChangeCurrentCarIcon" /> - - - - - - - - + android:layout_height="match_parent" + android:orientation="vertical"> + app:layout_constraintTop_toBottomOf="@+id/ivCameraIcon" /> + + + \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/values/attr.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/values/attr.xml index cb5e3610d1..7e72417466 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/res/values/attr.xml +++ b/core/function-impl/mogo-core-function-hmi/src/main/res/values/attr.xml @@ -69,9 +69,4 @@ @android:color/transparent - - - - - \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/V2XEventManager.kt b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/V2XEventManager.kt index 711fde9e88..c67989c8b8 100644 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/V2XEventManager.kt +++ b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/V2XEventManager.kt @@ -19,7 +19,7 @@ import com.mogo.eagle.core.data.map.entity.MarkerExploreWay import com.mogo.eagle.core.data.map.entity.MarkerShowEntity import com.mogo.eagle.core.data.map.entity.V2XMessageEntity import com.mogo.eagle.core.data.map.entity.V2XRoadEventEntity -import com.mogo.eagle.core.data.msgbox.DataSourceType +import com.mogo.eagle.core.data.enums.DataSourceType import com.mogo.eagle.core.data.msgbox.MsgBoxBean import com.mogo.eagle.core.data.msgbox.MsgBoxType import com.mogo.eagle.core.data.msgbox.V2XMsg diff --git a/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/enums/DataSourceType.kt b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/enums/DataSourceType.kt new file mode 100644 index 0000000000..7cc8ddb8fa --- /dev/null +++ b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/enums/DataSourceType.kt @@ -0,0 +1,11 @@ +package com.mogo.eagle.core.data.enums + +enum class DataSourceType(name: String) { + DEFAULT("defalut"), + OBU("OBU"), + MAP("MAP"), + TELEMATIC("TELEMATIC"), + AICLOUD("AI云"), + SUMMARY("汇总")// V2X事件汇总 + +} \ No newline at end of file diff --git a/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/msgbox/DataSourceType.kt b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/msgbox/DataSourceType.kt deleted file mode 100644 index af15d0b8a7..0000000000 --- a/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/msgbox/DataSourceType.kt +++ /dev/null @@ -1,9 +0,0 @@ -package com.mogo.eagle.core.data.msgbox - -enum class DataSourceType { - DEFAULT, - OBU, - TELEMATIC, - AICLOUD, - SUMMARY// V2X事件汇总 -} \ No newline at end of file diff --git a/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/msgbox/MsgBoxBean.kt b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/msgbox/MsgBoxBean.kt index 9c370be85d..0626508331 100644 --- a/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/msgbox/MsgBoxBean.kt +++ b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/msgbox/MsgBoxBean.kt @@ -1,5 +1,7 @@ package com.mogo.eagle.core.data.msgbox +import com.mogo.eagle.core.data.enums.DataSourceType + data class MsgBoxBean(val type: MsgBoxType, val bean: Any) { var timestamp: Long = 0 var bean2Json: String = "" diff --git a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/hmi/IMoGoHmiViewProxy.kt b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/hmi/IMoGoHmiViewProxy.kt index 7dd525ac24..7b760ac015 100644 --- a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/hmi/IMoGoHmiViewProxy.kt +++ b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/hmi/IMoGoHmiViewProxy.kt @@ -1,7 +1,5 @@ package com.mogo.eagle.core.function.api.hmi -import com.mogo.eagle.core.function.api.hmi.view.IViewLimitingVelocity -import com.mogo.eagle.core.function.api.hmi.view.IViewNotification import com.mogo.eagle.core.function.api.hmi.view.IViewTrafficLight /** @@ -15,10 +13,4 @@ interface IMoGoHmiViewProxy { */ fun setProxyTrafficLightView(view: IViewTrafficLight) - /** - * 设置 限速 代理View - * @param view - */ - fun setProxyLimitingSpeedView(view: IViewLimitingVelocity) - } \ No newline at end of file diff --git a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/hmi/view/IViewControlListener.kt b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/hmi/view/IViewControlListener.kt index 4a1c67310f..2bdf8d3bce 100644 --- a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/hmi/view/IViewControlListener.kt +++ b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/hmi/view/IViewControlListener.kt @@ -5,12 +5,8 @@ import android.view.ViewGroup interface IViewControlListener { companion object{ - const val SpeedPanelView_TAG = "SpeedPanelView_TAG" - const val AutoPilotStatusView_TAG = "AutoPilotStatusView_TAG" - const val PerspectiveSwitchView_TAG = "PerspectiveSwitchView_TAG" - const val CameraView_TAG = "CameraView_TAG" - const val ToolsView_TAG = "ToolsView_TAG" const val TrafficLightView_TAG = "TrafficLightView_TAG" + const val LimitingVelocityView_TAG = "LimitingVelocityView_TAG" } /** --------- View --------- **/ diff --git a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/hmi/view/IViewLimitingVelocity.kt b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/hmi/view/IViewLimitingVelocity.kt deleted file mode 100644 index c1b5499a1d..0000000000 --- a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/hmi/view/IViewLimitingVelocity.kt +++ /dev/null @@ -1,19 +0,0 @@ -package com.mogo.eagle.core.function.api.hmi.view - -import android.content.Context -import android.util.AttributeSet -import android.widget.LinearLayout - -/** - * 定义限速View具备的接口 - */ -abstract class IViewLimitingVelocity(context: Context?, attrs: AttributeSet?, defStyleAttr: Int) : - LinearLayout(context, attrs, defStyleAttr) { - - /** - * 更新限速数据 - * @param limitingSpeed 限速值,单位:km/h - * @param limitSource 限速来源 1:MAP, 2:RSU - */ - open fun updateLimitingSpeed(limitingSpeed: Int, limitSource: Int) {} -} \ No newline at end of file diff --git a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/hmi/warning/IMoGoHmiProvider.kt b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/hmi/warning/IMoGoHmiProvider.kt index 266eaa8fa6..928554ef5b 100644 --- a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/hmi/warning/IMoGoHmiProvider.kt +++ b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/hmi/warning/IMoGoHmiProvider.kt @@ -1,6 +1,5 @@ package com.mogo.eagle.core.function.api.hmi.warning -import android.view.View import android.view.ViewGroup import com.mogo.eagle.core.data.bindingcar.IPCUpgradeStateInfo import com.mogo.eagle.core.data.dispatch.DispatchAdasAutoPilotLocReceiverBean @@ -22,38 +21,6 @@ interface IMoGoHmiProvider : IMoGoHmiViewProxy { */ fun displayEffects() - /** - * 隐藏 脉速表 - * @param visibility View.VISIBLE, View.INVISIBLE,View.GONE - */ - fun setSpeedChartViewVisibility(visibility: Int) - - /** - * 隐藏 红绿灯UI - * @param visibility View.VISIBLE, View.INVISIBLE,View.GONE - */ - fun setTrafficLightVrVisibility(visibility: Int) - - /** - * 隐藏 自动驾驶触发 按钮 - * @param visibility View.VISIBLE, View.INVISIBLE,View.GONE - */ - fun setAutopilotStatusViewVisibility(visibility: Int) - - /** - * 隐藏 切换视角 按钮 - * @param visibility View.VISIBLE, View.INVISIBLE,View.GONE - */ - fun setPerspectiveSwitchViewVisibility(visibility: Int) - - /** - * 隐藏 工具箱 按钮 - * @param visibility View.VISIBLE, View.INVISIBLE,View.GONE - */ - fun setToolsViewVisibility(visibility: Int) - - fun setCameraViewVisibility(visibility: Int) - /** * 控制转向灯 */ @@ -135,19 +102,6 @@ interface IMoGoHmiProvider : IMoGoHmiViewProxy { */ fun changeCountdownTrafficLightNum(readNum: Int, yellowNum: Int, greenNum: Int) - /** - * 展示限速预警 - * - * @param limitingSpeed 限速速度 - * @param limitSpeedSource 限速来源 1:MAP, 2:RSU - */ - fun showLimitingVelocity(limitingSpeed: Int, limitSpeedSource: Int) - - /** - * 关闭限速预警 - */ - fun disableLimitingVelocity() - /** * 展示指定方位上的红框预警 * @param direction diff --git a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/v2x/ILimitingVelocityListener.kt b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/v2x/ILimitingVelocityListener.kt new file mode 100644 index 0000000000..49bfecb6dd --- /dev/null +++ b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/v2x/ILimitingVelocityListener.kt @@ -0,0 +1,10 @@ +package com.mogo.eagle.core.function.api.v2x + +import com.mogo.eagle.core.data.enums.DataSourceType + +/** + * 限速信息回掉 + */ +interface ILimitingVelocityListener { + fun onLimitingVelocityChange(limitingVelocity: Int,sourceType: DataSourceType) +} \ No newline at end of file diff --git a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/v2x/LimitingVelocityListener.kt b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/v2x/LimitingVelocityListener.kt deleted file mode 100644 index 4df12373e2..0000000000 --- a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/v2x/LimitingVelocityListener.kt +++ /dev/null @@ -1,8 +0,0 @@ -package com.mogo.eagle.core.function.api.v2x - -/** - * 限速信息回掉 - */ -interface LimitingVelocityListener { - fun onLimitingVelocityChange(limitingVelocity: Int) -} \ No newline at end of file diff --git a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/v2x/ObuLimitingSpeedListener.kt b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/v2x/ObuLimitingSpeedListener.kt deleted file mode 100644 index 1fb84cdeaa..0000000000 --- a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/v2x/ObuLimitingSpeedListener.kt +++ /dev/null @@ -1,8 +0,0 @@ -package com.mogo.eagle.core.function.api.v2x - -/** - * 限速信息 - */ -interface ObuLimitingSpeedListener { - fun onObuLimitingSpeedChange(limitingSpeed: Int) -} \ No newline at end of file diff --git a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/hmi/CallerHmiManager.kt b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/hmi/CallerHmiManager.kt index 1a1eedf412..b89e16b16d 100644 --- a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/hmi/CallerHmiManager.kt +++ b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/hmi/CallerHmiManager.kt @@ -1,23 +1,18 @@ package com.mogo.eagle.core.function.call.hmi -import android.view.View import android.view.ViewGroup import com.alibaba.android.arouter.launcher.ARouter import com.mogo.eagle.core.data.bindingcar.IPCUpgradeStateInfo import com.mogo.eagle.core.data.constants.MoGoFragmentPaths -import com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig.Companion.BIZ_SLW -import com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig.Companion.V2I import com.mogo.eagle.core.data.dispatch.DispatchAdasAutoPilotLocReceiverBean import com.mogo.eagle.core.data.enums.WarningDirectionEnum import com.mogo.eagle.core.data.map.Infrastructure import com.mogo.eagle.core.data.notice.NoticeNormalData import com.mogo.eagle.core.data.notice.NoticeTrafficStylePushData import com.mogo.eagle.core.data.report.ReportEntity -import com.mogo.eagle.core.function.api.hmi.view.IViewLimitingVelocity import com.mogo.eagle.core.function.api.hmi.view.IViewTrafficLight import com.mogo.eagle.core.function.api.hmi.warning.IMoGoHmiProvider import com.mogo.eagle.core.function.api.hmi.warning.IMoGoWarningStatusListener -import com.zhjt.service_biz.BizConfig /** * @author xiaoyuzhou @@ -37,42 +32,6 @@ object CallerHmiManager { waringProviderApi?.displayEffects() } - /** - * 隐藏 脉速表 - * @param visibility View.VISIBLE, View.INVISIBLE,View.GONE - */ - fun setSpeedChartViewVisibility(visibility: Int) { - waringProviderApi?.setSpeedChartViewVisibility(visibility) - } - - /** - * 隐藏 自动驾驶触发 按钮 - * @param visibility View.VISIBLE, View.INVISIBLE,View.GONE - */ - fun setAutopilotStatusViewVisibility(visibility: Int) { - waringProviderApi?.setAutopilotStatusViewVisibility(visibility) - } - - /** - * 隐藏 切换视角 按钮 - * @param visibility View.VISIBLE, View.INVISIBLE,View.GONE - */ - fun setPerspectiveSwitchViewVisibility(visibility: Int) { - waringProviderApi?.setPerspectiveSwitchViewVisibility(visibility) - } - - /** - * 隐藏 工具箱 按钮 - * @param visibility View.VISIBLE, View.INVISIBLE,View.GONE - */ - fun setToolsViewVisibility(visibility: Int) { - waringProviderApi?.setToolsViewVisibility(visibility) - } - - fun setCameraViewVisibility(visibility: Int) { - waringProviderApi?.setCameraViewVisibility(visibility) - } - /** * 控制转向灯功能 */ @@ -200,24 +159,6 @@ object CallerHmiManager { waringProviderApi?.changeCountdownTrafficLightNum(readNum, yellowNum, greenNum) } - /** - * 展示限速预警 - * - * @param limitingSpeed 限速速度 - * @param limitSpeedSource 限速来源 1:MAP, 2:RSU - */ - @BizConfig(V2I, "", BIZ_SLW) - fun showLimitingVelocity(limitingSpeed: Int, limitSpeedSource: Int) { - waringProviderApi?.showLimitingVelocity(limitingSpeed, limitSpeedSource) - } - - /** - * 关闭限速预警 - */ - fun disableLimitingVelocity() { - waringProviderApi?.disableLimitingVelocity() - } - /** * 展示指定方位上的红框预警 * @param direction @@ -346,14 +287,6 @@ object CallerHmiManager { waringProviderApi?.setProxyTrafficLightView(view) } - /** - * 设置 限速 代理View - * @param view - */ - fun setProxyLimitingSpeedView(view: IViewLimitingVelocity) { - waringProviderApi?.setProxyLimitingSpeedView(view) - } - /** * 展示工控机监控上报数据 * @param errorReportList 错误级别上报数据列表 diff --git a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/v2x/CallLimitingVelocityListenerManager.kt b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/v2x/CallLimitingVelocityListenerManager.kt deleted file mode 100644 index 726288cd2d..0000000000 --- a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/v2x/CallLimitingVelocityListenerManager.kt +++ /dev/null @@ -1,29 +0,0 @@ -package com.mogo.eagle.core.function.call.v2x - -import com.mogo.eagle.core.function.api.v2x.LimitingVelocityListener -import com.mogo.eagle.core.function.call.base.CallerBase - -/** - * 限速信息监听 - */ -object CallLimitingVelocityListenerManager : CallerBase() { - - private const val TAG = "CallLimitingVelocityListenerManager" - - private var mCurrentLimitingVelocity = 0 - - override fun doSomeAfterAddListener(tag: String, listener: LimitingVelocityListener) { - listener.onLimitingVelocityChange(mCurrentLimitingVelocity) - } - - fun invokeOnLimitingVelocityChange(limitingVelocity: Int) { - this.mCurrentLimitingVelocity = limitingVelocity - M_LISTENERS.forEach { - val tag = it.key - //LogUtils.dTag(TAG, "invokeOnLimitingVelocityChange tag is : $tag") - val listener = it.value - listener.onLimitingVelocityChange(limitingVelocity) - } - } - -} \ No newline at end of file diff --git a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/v2x/CallObuLimitingSpeedListenerManager.kt b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/v2x/CallObuLimitingSpeedListenerManager.kt deleted file mode 100644 index 1a33b7af68..0000000000 --- a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/v2x/CallObuLimitingSpeedListenerManager.kt +++ /dev/null @@ -1,26 +0,0 @@ -package com.mogo.eagle.core.function.call.v2x - -import com.mogo.eagle.core.function.api.v2x.ObuLimitingSpeedListener -import com.mogo.eagle.core.function.call.base.CallerBase -import java.util.concurrent.ConcurrentHashMap - -/** - * 限速信息监听 - */ -object CallObuLimitingSpeedListenerManager : CallerBase(){ - - private const val TAG = "CallObuLimitingSpeedListenerManager" - private val M_TRAFFIC_LIGHT_LISTENER: ConcurrentHashMap = - ConcurrentHashMap() - private var mObuLimitSpeed = 0 - - fun invokeOnObuLimitingSpeedChange(limitingSpeed: Int) { - this.mObuLimitSpeed = limitingSpeed - M_TRAFFIC_LIGHT_LISTENER.forEach { - val tag = it.key - val listener = it.value - listener.onObuLimitingSpeedChange(limitingSpeed) - } - } - -} \ No newline at end of file diff --git a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/v2x/CallerLimitingVelocityListenerManager.kt b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/v2x/CallerLimitingVelocityListenerManager.kt new file mode 100644 index 0000000000..4d9211b39c --- /dev/null +++ b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/v2x/CallerLimitingVelocityListenerManager.kt @@ -0,0 +1,28 @@ +package com.mogo.eagle.core.function.call.v2x + +import com.mogo.eagle.core.data.enums.DataSourceType +import com.mogo.eagle.core.function.api.v2x.ILimitingVelocityListener +import com.mogo.eagle.core.function.call.base.CallerBase + +/** + * 限速信息监听 + */ +object CallerLimitingVelocityListenerManager : CallerBase() { + + private var mCurrentLimitingVelocity = 0 + private var sourceType = DataSourceType.DEFAULT + + override fun doSomeAfterAddListener(tag: String, listener: ILimitingVelocityListener) { + listener.onLimitingVelocityChange(mCurrentLimitingVelocity, sourceType) + } + + fun invokeOnLimitingVelocityChange(limitingVelocity: Int, sourceType: DataSourceType) { + this.mCurrentLimitingVelocity = limitingVelocity + this.sourceType = sourceType + M_LISTENERS.forEach { + val listener = it.value + listener.onLimitingVelocityChange(limitingVelocity, sourceType) + } + } + +} \ No newline at end of file diff --git a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/v2x/CallerViewLimitingVelocityListenerManager.kt b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/v2x/CallerViewLimitingVelocityListenerManager.kt new file mode 100644 index 0000000000..cdfbe782b8 --- /dev/null +++ b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/v2x/CallerViewLimitingVelocityListenerManager.kt @@ -0,0 +1,28 @@ +package com.mogo.eagle.core.function.call.v2x + +import com.mogo.eagle.core.data.enums.DataSourceType +import com.mogo.eagle.core.function.api.v2x.ILimitingVelocityListener +import com.mogo.eagle.core.function.call.base.CallerBase + +/** + * 限速信息监听 + */ +object CallerViewLimitingVelocityListenerManager : CallerBase() { + + private var mCurrentLimitingVelocity = 0 + private var sourceType = DataSourceType.DEFAULT + + override fun doSomeAfterAddListener(tag: String, listener: ILimitingVelocityListener) { + listener.onLimitingVelocityChange(mCurrentLimitingVelocity, sourceType) + } + + fun invokeOnLimitingVelocityChange(limitingVelocity: Int, sourceType: DataSourceType) { + this.mCurrentLimitingVelocity = limitingVelocity + this.sourceType = sourceType + M_LISTENERS.forEach { + val listener = it.value + listener.onLimitingVelocityChange(limitingVelocity, sourceType) + } + } + +} \ No newline at end of file From 66db271f6c16ec8c1921950b794427f16c989184 Mon Sep 17 00:00:00 2001 From: zhongchao Date: Mon, 30 Jan 2023 22:29:40 +0800 Subject: [PATCH 09/18] [2.13.0-arch-opt] merg --- .../src/main/res/layout/bus_base_fragment.xml | 1 + OCH/mogo-och-noop/build.gradle | 19 ++++++++---- .../java/com/mogo/och/noop/OCHConstants.java | 2 +- .../java/com/mogo/och/noop/OchNoopFragment.kt | 3 +- .../main/res/layout/och_noop_fragment_hmi.xml | 12 +++---- .../main/res/layout/taxi_base_fragment.xml | 1 + app/productFlavors/fPadLenovo.gradle | 2 +- .../eagle/function/biz/FuncBizProvider.kt | 6 ++-- .../v2x/speedlimit/SpeedLimitDispatcher.kt | 2 +- .../mogo-core-function-hmi/build.gradle | 1 - .../receiver/V2XWarningBroadcastReceiver.kt | 4 ++- .../function/hmi/ui/tools/ToolsImageView.kt | 2 +- .../hmi/ui/widget/AutoPilotStatusView.kt | 7 +---- .../function/main/MainLauncherActivity.java | 6 +++- .../res/layout/view_limiting_speed_vr.xml | 8 ++--- .../business}/SpeedLimitDataManager.java | 31 +++++++------------ .../eagle/core/function/map/MapFragment.kt | 3 ++ 17 files changed, 52 insertions(+), 58 deletions(-) rename core/function-impl/{mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/speedlimit => mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business}/SpeedLimitDataManager.java (61%) diff --git a/OCH/mogo-och-bus/src/main/res/layout/bus_base_fragment.xml b/OCH/mogo-och-bus/src/main/res/layout/bus_base_fragment.xml index 8cc5bfec82..da6d779a3b 100644 --- a/OCH/mogo-och-bus/src/main/res/layout/bus_base_fragment.xml +++ b/OCH/mogo-och-bus/src/main/res/layout/bus_base_fragment.xml @@ -68,6 +68,7 @@ android:layout_height="wrap_content" android:layout_marginTop="@dimen/hmi_traffic_light_layout_margin_top" android:layout_marginEnd="@dimen/hmi_traffic_light_layout_margin_right" + android:visibility="gone" app:layout_constraintRight_toRightOf="parent" app:layout_constraintTop_toTopOf="parent" /> diff --git a/OCH/mogo-och-noop/build.gradle b/OCH/mogo-och-noop/build.gradle index d9254953fe..835c4f0715 100644 --- a/OCH/mogo-och-noop/build.gradle +++ b/OCH/mogo-och-noop/build.gradle @@ -1,5 +1,10 @@ -apply plugin: 'com.android.library' -apply plugin: 'com.alibaba.arouter' +plugins { + id 'com.android.library' + id 'kotlin-android' + id 'kotlin-android-extensions' + id 'kotlin-kapt' + id 'com.alibaba.arouter' +} android { compileSdkVersion rootProject.ext.android.compileSdkVersion @@ -13,10 +18,11 @@ android { testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" consumerProguardFiles "consumer-rules.pro" - - javaCompileOptions { - annotationProcessorOptions { - arguments = [AROUTER_MODULE_NAME: project.getName()] + //ARouter apt 参数 + kapt { + useBuildCache = false + arguments { + arg("AROUTER_MODULE_NAME", project.getName()) } } } @@ -43,6 +49,7 @@ dependencies { implementation rootProject.ext.dependencies.arouter annotationProcessor rootProject.ext.dependencies.aroutercompiler + kapt rootProject.ext.dependencies.aroutercompiler if (Boolean.valueOf(USE_MAVEN_PACKAGE)) { implementation rootProject.ext.dependencies.mogoutils diff --git a/OCH/mogo-och-noop/src/main/java/com/mogo/och/noop/OCHConstants.java b/OCH/mogo-och-noop/src/main/java/com/mogo/och/noop/OCHConstants.java index b0893ba9f8..8a5d17c35a 100644 --- a/OCH/mogo-och-noop/src/main/java/com/mogo/och/noop/OCHConstants.java +++ b/OCH/mogo-och-noop/src/main/java/com/mogo/och/noop/OCHConstants.java @@ -12,5 +12,5 @@ class OCHConstants { /** * arouter 路由地址 */ - public static final String PATH = "/och/noop/api"; + public static final String PATH = "/noop/api"; } diff --git a/OCH/mogo-och-noop/src/main/java/com/mogo/och/noop/OchNoopFragment.kt b/OCH/mogo-och-noop/src/main/java/com/mogo/och/noop/OchNoopFragment.kt index 26b72274dc..745f4e0ab3 100644 --- a/OCH/mogo-och-noop/src/main/java/com/mogo/och/noop/OchNoopFragment.kt +++ b/OCH/mogo-och-noop/src/main/java/com/mogo/och/noop/OchNoopFragment.kt @@ -3,7 +3,7 @@ package com.mogo.och.noop import android.view.View import com.mogo.commons.mvp.MvpFragment import com.mogo.eagle.core.function.hmi.ui.setting.ToggleDebugView -import kotlinx.android.synthetic.main.fragment_hmi.* +import kotlinx.android.synthetic.main.och_noop_fragment_hmi.* class OchNoopFragment : MvpFragment(), OchNoopContract.View { @@ -25,7 +25,6 @@ class OchNoopFragment : MvpFragment(), } override fun initViews() { - viewShowDebugView.setOnLongClickListener { ToggleDebugView.toggleDebugView.toggle(requireContext()) true diff --git a/OCH/mogo-och-noop/src/main/res/layout/och_noop_fragment_hmi.xml b/OCH/mogo-och-noop/src/main/res/layout/och_noop_fragment_hmi.xml index fb1bec67f4..34c117a11e 100644 --- a/OCH/mogo-och-noop/src/main/res/layout/och_noop_fragment_hmi.xml +++ b/OCH/mogo-och-noop/src/main/res/layout/och_noop_fragment_hmi.xml @@ -67,8 +67,7 @@ android:layout_marginTop="@dimen/module_mogo_autopilot_status_margin_top" android:elevation="@dimen/dp_10" app:layout_constraintLeft_toLeftOf="@+id/viewSpeedChart" - app:layout_constraintTop_toBottomOf="@+id/viewSpeedChart" - app:layout_goneMarginStart="@dimen/module_mogo_autopilot_status_margin_left" /> + app:layout_constraintTop_toBottomOf="@+id/viewSpeedChart"/> + app:layout_constraintRight_toRightOf="parent" + app:layout_constraintTop_toBottomOf="@+id/ivCameraIcon" /> diff --git a/app/productFlavors/fPadLenovo.gradle b/app/productFlavors/fPadLenovo.gradle index 3f81f59165..1ad7d6b469 100644 --- a/app/productFlavors/fPadLenovo.gradle +++ b/app/productFlavors/fPadLenovo.gradle @@ -24,7 +24,7 @@ project.android.productFlavors { buildConfigField 'int', 'GPS_PROVIDER', "1" // 构建的应用身份类型,具体查看 README.md APP_IDENTITY_MODE规则 - buildConfigField 'String', 'APP_IDENTITY_MODE', "\"Taxi_Driver_Base\"" + buildConfigField 'String', 'APP_IDENTITY_MODE', "\"FPad_Noop_Base\"" // 连接的工控机IP地址 buildConfigField 'String', 'ADAS_CONNECT_IP', "\"192.168.1.104\"" // 构建的是否是演示(美化)模式 diff --git a/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/FuncBizProvider.kt b/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/FuncBizProvider.kt index 528509bea4..d0831a75ef 100644 --- a/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/FuncBizProvider.kt +++ b/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/FuncBizProvider.kt @@ -10,7 +10,6 @@ import com.mogo.eagle.function.biz.dispatch.DispatchAutoPilotManager.Companion.d import com.mogo.eagle.function.biz.monitoring.CronTaskManager.Companion.cronTaskManager import com.mogo.eagle.function.biz.notice.NoticeSocketManager.Companion.noticeSocketManager import com.mogo.eagle.function.biz.notice.network.NoticeNetWorkManager -import com.mogo.eagle.function.biz.v2x.speedlimit.SpeedLimitDataManager import com.mogo.eagle.function.biz.v2x.speedlimit.SpeedLimitDispatcher import com.mogo.eagle.function.biz.v2x.trafficlight.core.MogoTrafficLightManager import com.mogo.eagle.function.biz.v2x.trafficlight.core.TrafficLightDispatcher @@ -28,10 +27,9 @@ class FuncBizProvider : IMoGoFuncBizProvider { cronTaskManager.startCronTask() MogoTrafficLightManager.INSTANCE.initServer(context) - TrafficLightDispatcher.INSTANCE.initServer(context) //todo 红绿灯中心模块放入dataCenter VipCarManager.INSTANCE.initServer(context) - SpeedLimitDataManager.getInstance().start() - SpeedLimitDispatcher.INSTANCE.initLimit(context) + TrafficLightDispatcher.INSTANCE.initServer(context) //todo 宏宇 放入dataCenter + SpeedLimitDispatcher.INSTANCE.initLimit(context) //todo 宏宇,放入dataCenter // RedLightWarningManager.INSTANCE.listenTrafficLight() } diff --git a/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/speedlimit/SpeedLimitDispatcher.kt b/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/speedlimit/SpeedLimitDispatcher.kt index 47e491ac75..cc61f8f8b3 100644 --- a/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/speedlimit/SpeedLimitDispatcher.kt +++ b/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/speedlimit/SpeedLimitDispatcher.kt @@ -34,7 +34,7 @@ class SpeedLimitDispatcher : ILimitingVelocityListener { /** * 地图限速数据 */ - @BizConfig(FuncBizConfig.V2I, "", FuncBizConfig.BIZ_SLW) +// @BizConfig(FuncBizConfig.V2I, "", FuncBizConfig.BIZ_SLW) //todo arrow 重新考虑放的位置 override fun onLimitingVelocityChange(limitingVelocity: Int, sourceType: DataSourceType) { when (sourceType) { // obu 优先级高于 map,体现链路能力 DataSourceType.OBU -> { diff --git a/core/function-impl/mogo-core-function-hmi/build.gradle b/core/function-impl/mogo-core-function-hmi/build.gradle index cfbb042e0e..d5bdc3d080 100644 --- a/core/function-impl/mogo-core-function-hmi/build.gradle +++ b/core/function-impl/mogo-core-function-hmi/build.gradle @@ -108,7 +108,6 @@ dependencies { api project(':core:function-impl:mogo-core-function-chat') api project(':core:function-impl:mogo-core-function-datacenter') api project(':core:function-impl:mogo-core-function-biz') - api project(':core:mogo-core-function-call') api project(':libraries:mogo-adas') api project(':libraries:map-usbcamera') diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/receiver/V2XWarningBroadcastReceiver.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/receiver/V2XWarningBroadcastReceiver.kt index 30f289c218..fefd2b4366 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/receiver/V2XWarningBroadcastReceiver.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/receiver/V2XWarningBroadcastReceiver.kt @@ -4,6 +4,7 @@ import android.content.BroadcastReceiver import android.content.Context import android.content.Intent import android.util.Log +import com.mogo.eagle.core.data.enums.DataSourceType import com.mogo.eagle.core.data.enums.EventTypeEnumNew import com.mogo.eagle.core.function.call.hmi.CallerHmiManager import com.mogo.eagle.core.function.hmi.WaringConst @@ -13,6 +14,7 @@ import com.mogo.eagle.core.data.msgbox.MsgBoxBean import com.mogo.eagle.core.data.msgbox.MsgBoxType import com.mogo.eagle.core.data.msgbox.V2XMsg import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxManager +import com.mogo.eagle.core.function.call.v2x.CallerViewLimitingVelocityListenerManager /** * V2X 预警广播接收。用于跨应用,跨进程,内部也可以通过这种方式弹出预警提示框 @@ -76,7 +78,7 @@ class V2XWarningBroadcastReceiver : BroadcastReceiver() { tag: String? ) { if (EventTypeEnumNew.TYPE_USECASE_ID_IVP_RED.poiType == v2xType.toString()) { - CallerHmiManager.showLimitingVelocity(1, 1) + CallerViewLimitingVelocityListenerManager.invokeOnLimitingVelocityChange(1,DataSourceType.MAP) } if (alertContent.isNullOrEmpty() || ttsContent.isNullOrEmpty()) { Log.d("MsgBox-V2XWarningBR", "alertContent或ttsContent为空!") diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/tools/ToolsImageView.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/tools/ToolsImageView.kt index 2e8b24e018..5623ea7559 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/tools/ToolsImageView.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/tools/ToolsImageView.kt @@ -10,9 +10,9 @@ class ToolsImageView(context: Context, attrs: AttributeSet?) : override fun onAttachedToWindow() { super.onAttachedToWindow() + scaleType = ScaleType.CENTER setBackgroundResource(R.drawable.module_ext_check) setImageResource(R.drawable.icon_tools_nor) - scaleType = ScaleType.CENTER setOnClickListener{ toolsView.showToolsFloat(context) } diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/AutoPilotStatusView.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/AutoPilotStatusView.kt index 2ff479a1c7..76b47b683c 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/AutoPilotStatusView.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/AutoPilotStatusView.kt @@ -38,18 +38,13 @@ class AutoPilotStatusView constructor( private var mAutopilotStatus: Int = 0 - override fun onAttachedToWindow() { - super.onAttachedToWindow() + init{ initView(context) } private fun initView(context: Context) { setBackgroundResource(R.drawable.module_hmi_autopilot_status_bg) LayoutInflater.from(context).inflate(R.layout.view_autopilot_status, this, true) - - val lp = LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT) - layoutParams = lp - // 设置点击监听 setOnClickListener(this) // 自动驾驶状态监听 diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/main/MainLauncherActivity.java b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/main/MainLauncherActivity.java index d87460910c..18977a81a3 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/main/MainLauncherActivity.java +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/main/MainLauncherActivity.java @@ -149,10 +149,14 @@ public class MainLauncherActivity extends MainActivity implements IMogoIntentLis ochProvider = (IMoGoFunctionProvider) ARouter.getInstance() .build("/driver/api") .navigation(getContext()); - } else { + } else if(AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode)){ ochProvider = (IMoGoFunctionProvider) ARouter.getInstance() .build("/passenger/api") .navigation(getContext()); + } else { + ochProvider = (IMoGoFunctionProvider) ARouter.getInstance() + .build("/noop/api") + .navigation(getContext()); } } // 处理一个机器多个屏幕方案 diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_limiting_speed_vr.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_limiting_speed_vr.xml index 1b5042bf60..e3c35e2bfc 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_limiting_speed_vr.xml +++ b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_limiting_speed_vr.xml @@ -14,9 +14,7 @@ android:gravity="center" android:text="60" android:textColor="#FFFFFF" - android:textSize="@dimen/dp_60" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintTop_toBottomOf="@+id/ivCameraIcon" /> + android:textSize="@dimen/dp_60"/> + android:visibility="gone" /> \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/speedlimit/SpeedLimitDataManager.java b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/SpeedLimitDataManager.java similarity index 61% rename from core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/speedlimit/SpeedLimitDataManager.java rename to core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/SpeedLimitDataManager.java index 385cfb841e..950ed0e66f 100644 --- a/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/speedlimit/SpeedLimitDataManager.java +++ b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/SpeedLimitDataManager.java @@ -1,17 +1,15 @@ -package com.mogo.eagle.function.biz.v2x.speedlimit; - -import static com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig.BIZ_SLW; -import static com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig.V2I; +package com.mogo.eagle.core.function.business; import androidx.annotation.Nullable; +import com.mogo.eagle.core.data.enums.DataSourceType; import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationGCJ02Listener; import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ20ListenerManager; import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager; import com.mogo.eagle.core.function.call.v2x.CallerLimitingVelocityListenerManager; import com.mogo.eagle.core.utilcode.util.UiThreadHandler; -import com.zhjt.service_biz.BizConfig; +import java.util.Objects; import java.util.Timer; import java.util.TimerTask; @@ -25,8 +23,8 @@ import mogo.telematics.pad.MessagePad; public class SpeedLimitDataManager implements IMoGoChassisLocationGCJ02Listener { private final static String TAG = "SpeedLimitDataManager"; - private static SpeedLimitDataManager instance; - private MessagePad.GnssInfo mLocation; + private static volatile SpeedLimitDataManager instance; + private MessagePad.GnssInfo mLocation; private SpeedLimitDataManager() { } @@ -51,24 +49,19 @@ public class SpeedLimitDataManager implements IMoGoChassisLocationGCJ02Listener @Override public void run() { if (mLocation != null) { - if(CallerMapUIServiceManager.INSTANCE.getMapUIController()!=null){ + if (CallerMapUIServiceManager.INSTANCE.getMapUIController() != null) { getSpeedLimit(); } } } - @BizConfig(biz = V2I, dependentBizNode = "", bizNode = BIZ_SLW) private void getSpeedLimit() { -// if (!isShowObuLimitSpeedView) { - int speedLimit = CallerMapUIServiceManager.INSTANCE.getMapUIController().getLimitSpeed(mLocation.getLongitude(), mLocation.getLatitude(), (float) mLocation.getHeading()); - UiThreadHandler.post(() -> { - if (speedLimit > 0) { -// CallerHmiManager.INSTANCE.showLimitingVelocity(speedLimit, 1); - CallerLimitingVelocityListenerManager.INSTANCE.invokeOnLimitingVelocityChange(speedLimit); - - } - }); -// } + int speedLimit = Objects.requireNonNull(CallerMapUIServiceManager.INSTANCE.getMapUIController()).getLimitSpeed(mLocation.getLongitude(), mLocation.getLatitude(), (float) mLocation.getHeading()); + UiThreadHandler.post(() -> { + if (speedLimit > 0) { + CallerLimitingVelocityListenerManager.INSTANCE.invokeOnLimitingVelocityChange(speedLimit, DataSourceType.MAP); + } + }); } } diff --git a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/map/MapFragment.kt b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/map/MapFragment.kt index a6cb1e9874..0591bc9c92 100644 --- a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/map/MapFragment.kt +++ b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/map/MapFragment.kt @@ -15,6 +15,7 @@ import com.mogo.eagle.core.function.api.autopilot.IMoGoPlanningRottingListener import com.mogo.eagle.core.function.api.map.hd.IMoGoMapFragmentProvider import com.mogo.eagle.core.function.api.setting.IMoGoSkinModeChangeListener import com.mogo.eagle.core.function.business.MapPointCloudSubscriber +import com.mogo.eagle.core.function.business.SpeedLimitDataManager import com.mogo.eagle.core.function.business.identify.MapIdentifySubscriber import com.mogo.eagle.core.function.business.routeoverlay.MogoRouteOverlayManager import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationWGS84ListenerManager @@ -199,6 +200,8 @@ class MapFragment : MvpFragment(), MapIdentifySubscriber.instance MogoRouteOverlayManager.getInstance().init() MapPointCloudSubscriber.instance + SpeedLimitDataManager.getInstance().start() + // TODO GD地图业务需要与高精地图业务拆开 --- 扶风 queryInfStructure() } From a8cfaa8fff88a45f30770178abdbf1c4a6e3a401 Mon Sep 17 00:00:00 2001 From: donghongyu Date: Tue, 31 Jan 2023 10:43:13 +0800 Subject: [PATCH 10/18] =?UTF-8?q?[dev=5Farch=5Fopt=5F3.0]=20[Change]=20[?= =?UTF-8?q?=201=E3=80=81=E4=BF=AE=E5=A4=8D=E5=90=88=E5=B9=B6=E5=BC=82?= =?UTF-8?q?=E5=B8=B8=20]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: donghongyu --- .../core/function/datacenter/obu/MogoPrivateObuNewManager.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/obu/MogoPrivateObuNewManager.kt b/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/obu/MogoPrivateObuNewManager.kt index c06aacde0b..503a372c83 100644 --- a/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/obu/MogoPrivateObuNewManager.kt +++ b/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/obu/MogoPrivateObuNewManager.kt @@ -18,7 +18,7 @@ import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxManager import com.mogo.eagle.core.function.call.obu.CallerObuListenerManager import com.mogo.eagle.core.function.call.obu.CallerObuTrafficLightListenerManager import com.mogo.eagle.core.function.call.v2x.CallerLimitingVelocityListenerManager -import com.mogo.eagle.core.function.obu.mogo.utils.TrafficDataConvertUtilsNew +import com.mogo.eagle.core.function.datacenter.obu.utils.TrafficDataConvertUtilsNew import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_OBU import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr From 6bc41b01fa05162f5a4df680ad9e1e8e6d4410cb Mon Sep 17 00:00:00 2001 From: donghongyu Date: Tue, 31 Jan 2023 11:45:10 +0800 Subject: [PATCH 11/18] =?UTF-8?q?[dev=5Farch=5Fopt=5F3.0]=20[Change]=20[?= =?UTF-8?q?=201=E3=80=81TODO=20=E6=B8=85=E6=89=AB=E8=BD=A6=E9=99=90?= =?UTF-8?q?=E9=80=9F=E6=9C=89=E9=97=AE=E9=A2=98=20]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: donghongyu --- .../com/mogo/och/sweeper/view/SweeperTrafficDataView.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/OCH/mogo-och-sweeper/src/main/java/com/mogo/och/sweeper/view/SweeperTrafficDataView.java b/OCH/mogo-och-sweeper/src/main/java/com/mogo/och/sweeper/view/SweeperTrafficDataView.java index 23cc010b44..580b3417e5 100644 --- a/OCH/mogo-och-sweeper/src/main/java/com/mogo/och/sweeper/view/SweeperTrafficDataView.java +++ b/OCH/mogo-och-sweeper/src/main/java/com/mogo/och/sweeper/view/SweeperTrafficDataView.java @@ -147,8 +147,8 @@ public class SweeperTrafficDataView extends ConstraintLayout @Override public void onLimitingVelocityChange(int limitingVelocity, DataSourceType sourceType) { - //设置限速 - sweeperLimitingVelocity.updateLimitingSpeed(limitingVelocity, 0); + //设置限速 TODO @钟超 + //sweeperLimitingVelocity.updateLimitingSpeed(limitingVelocity, 0); } }; /** From e01716f30ac7f8ba7affa7c6ccf67d2314708852 Mon Sep 17 00:00:00 2001 From: renwj Date: Tue, 31 Jan 2023 12:20:42 +0800 Subject: [PATCH 12/18] =?UTF-8?q?[dev=5Farch=5Fopt=5F3.0][v2x]v2x=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=E9=87=8D=E6=9E=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/AndroidManifest.xml | 2 +- .../function/v2x/events/V2XEventManager.kt | 68 ++--------- .../v2x/events/alarm/V2XAlarmServer.java | 19 +-- .../function/v2x/events/bridge/BridgeApi.kt | 13 -- .../events/manager/IMoGoV2XMarkerManager.java | 21 ---- .../manager/IMoGoV2XPolylineManager.java | 31 ----- .../IMoGoV2XStatusChangedListener.java | 19 --- .../events/manager/IMoGoV2XStatusManager.java | 34 ------ .../events/manager/V2XStatusDescriptor.java | 70 ----------- .../v2x/events/manager/V2XStatusManager.java | 61 ---------- .../manager/impl/MoGoV2XMarkerManager.java | 88 +------------- .../manager/impl/MoGoV2XPolylineManager.java | 114 ------------------ .../manager/impl/MoGoV2XStatusManager.java | 100 --------------- .../v2x/events/marker/V2XMarkerAdapter.java | 24 ---- .../events/observer/CarLocationObserver.java | 13 -- .../observer/V2XOptimalRouteObserver.java | 50 -------- .../overlay/V2XOptimalRouteOverlay.java | 77 ------------ .../MarkerRemoveManager.kt} | 4 +- .../scenario/impl/V2XScenarioManager.java | 6 - .../scenario/scene/airoad/AiRoadMarker.kt | 9 +- .../scene/road/V2XAiRoadEventMarker.kt | 2 +- .../scene/road/V2XRoadEventMarker.java | 22 +--- .../scene/road/V2XRoadEventScenario.java | 33 +---- .../route/V2XOptimalRouteVREventMarker.java | 54 --------- .../route/V2XOptimalRouteVREventScenario.java | 106 ---------------- .../warning/V2XFrontWarningScenario.java | 2 - .../scene/warning/V2XWarningMarker.java | 19 --- .../v2x/events/scenario/view/IV2XMarker.java | 3 - .../{utils => test}/TestOnLineCarUtils.java | 2 +- .../TestV2XReceiver.java} | 13 +- .../function/v2x/events/utils/TrackUtils.java | 1 - 31 files changed, 42 insertions(+), 1038 deletions(-) delete mode 100644 core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/manager/IMoGoV2XPolylineManager.java delete mode 100644 core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/manager/IMoGoV2XStatusChangedListener.java delete mode 100644 core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/manager/IMoGoV2XStatusManager.java delete mode 100644 core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/manager/V2XStatusDescriptor.java delete mode 100644 core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/manager/V2XStatusManager.java delete mode 100644 core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/manager/impl/MoGoV2XPolylineManager.java delete mode 100644 core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/manager/impl/MoGoV2XStatusManager.java delete mode 100644 core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/observer/CarLocationObserver.java delete mode 100644 core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/observer/V2XOptimalRouteObserver.java delete mode 100644 core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/overlay/V2XOptimalRouteOverlay.java rename core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/{marker/MarkerManager.kt => remove/MarkerRemoveManager.kt} (98%) delete mode 100644 core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/scene/route/V2XOptimalRouteVREventMarker.java delete mode 100644 core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/scene/route/V2XOptimalRouteVREventScenario.java rename core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/{utils => test}/TestOnLineCarUtils.java (99%) rename core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/{receiver/TestPanelBroadcastReceiver.java => test/TestV2XReceiver.java} (87%) diff --git a/core/function-impl/mogo-core-function-v2x/src/main/AndroidManifest.xml b/core/function-impl/mogo-core-function-v2x/src/main/AndroidManifest.xml index 6ccd24e6c8..246d716c51 100644 --- a/core/function-impl/mogo-core-function-v2x/src/main/AndroidManifest.xml +++ b/core/function-impl/mogo-core-function-v2x/src/main/AndroidManifest.xml @@ -2,7 +2,7 @@ - + diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/V2XEventManager.kt b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/V2XEventManager.kt index c67989c8b8..d8789a5797 100644 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/V2XEventManager.kt +++ b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/V2XEventManager.kt @@ -36,10 +36,8 @@ import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxManager import com.mogo.eagle.core.function.v2x.events.alarm.* import com.mogo.eagle.core.function.v2x.events.bridge.* import com.mogo.eagle.core.function.v2x.events.bridge.BridgeApi.context -import com.mogo.eagle.core.function.v2x.events.consts.* import com.mogo.eagle.core.function.v2x.events.consts.V2XConst.* import com.mogo.eagle.core.function.v2x.events.manager.* -import com.mogo.eagle.core.function.v2x.events.observer.* import com.mogo.eagle.core.function.v2x.events.receiver.* import com.mogo.eagle.core.function.v2x.events.scenario.impl.* import com.mogo.eagle.core.function.v2x.events.utils.* @@ -49,12 +47,10 @@ import com.mogo.eagle.core.function.v2x.internal.callback.IV2XCallback import com.mogo.eagle.core.function.v2x.internal.config.V2XConfig import com.mogo.eagle.core.function.v2x.internal.data.V2XAdvanceWarning import com.mogo.eagle.core.function.v2x.internal.data.V2XMarkerCardResult -import com.mogo.eagle.core.function.v2x.internal.data.V2XOptimalRoute import com.mogo.eagle.core.function.v2x.internal.data.V2XWarningTarget import com.mogo.eagle.core.function.v2x.internal.event.V2XEvent import com.mogo.eagle.core.function.v2x.road.V2XEventServiceApi import com.mogo.eagle.core.network.MoGoRetrofitFactory -import com.mogo.eagle.core.network.utils.* import com.mogo.eagle.core.utilcode.mogo.logger.* import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_V2X import com.mogo.eagle.core.utilcode.util.* @@ -132,7 +128,6 @@ object V2XEventManager : IMoGoChassisLocationGCJ02Listener, IMoGoTokenCallback, private fun unRegisterListener() { V2XManager.removeCallback(this) CallerChassisLocationGCJ20ListenerManager.removeListener(TAG) - mogoMarkersHandler.unregisterMarkerClickListener(CARD_TYPE_ROAD_CONDITION) } @@ -161,8 +156,8 @@ object V2XEventManager : IMoGoChassisLocationGCJ02Listener, IMoGoTokenCallback, v2XMessageEntity.isOnlyShow = true v2XMessageEntity.isNeedAddLine = false v2XMessageEntity.content = roadEventEntity - val intent = Intent(V2XConst.BROADCAST_SCENE_HANDLER_ACTION) - intent.putExtra(V2XConst.BROADCAST_SCENE_EXTRA_KEY, v2XMessageEntity) + val intent = Intent(BROADCAST_SCENE_HANDLER_ACTION) + intent.putExtra(BROADCAST_SCENE_EXTRA_KEY, v2XMessageEntity) LocalBroadcastManager.getInstance(context()).sendBroadcast(intent) //埋点 TrackUtils.trackV2XMarkerClick(2) @@ -193,18 +188,6 @@ object V2XEventManager : IMoGoChassisLocationGCJ02Listener, IMoGoTokenCallback, return null } - /** - * 刷新自车求助状态 - * - * @param isTrue - */ - private fun refreshMeSeekHelp(isTrue: Boolean) { - val entity = V2XMessageEntity() - entity.type = V2XMessageEntity.V2XTypeEnum.ALERT_CAR_FOR_HELP - entity.content = isTrue - V2XScenarioManager.getInstance().handlerMessage(entity) - } - override fun onChassisLocationGCJ02(gnssInfo: GnssInfo?) { val location = CallerMapLocationListenerManager.getCurrentLocation() ?: return BridgeApi.location.set(location) @@ -214,34 +197,12 @@ object V2XEventManager : IMoGoChassisLocationGCJ02Listener, IMoGoTokenCallback, latitude = location.latitude ) } - V2XOptimalRouteObserver.getInstance().update(location) refreshCarState(location) } private fun refreshCarState(location: MogoLocation) { - V2XStatusManager.getInstance().location = location - val v2xPolyline = BridgeApi.v2xPolyline()?.mogoPolyline - val isRoadEventPOIShow = BridgeApi.v2xStatus()?.isRoadEventPOIShow ?: false - val v2xStatusManager = V2XStatusManager.getInstance() - if (v2xPolyline != null && (isRoadEventPOIShow) && v2xStatusManager.targetMoGoLatLng != null) { // 取出原有的绘制线的经纬度点 - // 取出原有的绘制线的经纬度点 - val pointsOdl: MutableList = v2xPolyline.points // 重新设置第一个坐标,也就是当前车辆位置 - // 重新设置第一个坐标,也就是当前车辆位置 - pointsOdl[0] = MogoLatLng(location.latitude, location.longitude) - v2xPolyline.points = pointsOdl - //CallerLogger.d("$M_V2X$TAG", "当前地图的缩放比例为:" + zoomLevel); - val zoomLevel: Float = CallerMapUIServiceManager.getMapUIController()?.zoomLevel ?: 0.0f - //CallerLogger.d("$M_V2X$TAG", "当前地图的缩放比例为:" + zoomLevel); - if (zoomLevel > 0 && zoomLevel <= 17) { // 缩放地图 - val context: Context = context() - MapUtils.zoomMap(v2xStatusManager.targetMoGoLatLng, context) - } - } - // 巡航处理 val v2XRoadEventEntity = V2XAlarmServer.getDriveFrontAlarmEvent( - BridgeApi.v2xMarker()?.v2XRoadEventEntityList, - V2XStatusManager.getInstance().location - ) + BridgeApi.v2xMarker()?.v2XRoadEventEntityList, location) if (v2XRoadEventEntity != null) { val distance = v2XRoadEventEntity.distance val min = if (EventTypeEnumNew.isCloudSocketEvent(v2XRoadEventEntity.poiType)) 0 else 5 @@ -287,9 +248,6 @@ object V2XEventManager : IMoGoChassisLocationGCJ02Listener, IMoGoTokenCallback, is V2XEvent.ForwardsWarning -> { handleAdvanceWarningEvent(event) } - is V2XEvent.OptimalRoute -> { - handleOptimalRouteEvent(event) - } is V2XEvent.Marker -> { event.data.result?.let { handleRoadMarkerEvent(it) @@ -313,6 +271,9 @@ object V2XEventManager : IMoGoChassisLocationGCJ02Listener, IMoGoTokenCallback, is V2XEvent.RoadEventX -> { handleRoadMarkerEvent(event.data.toRoadMarker()) } + else -> { + Logger.d(TAG, "other event: $event") + } } } private fun handleWarningTargetEvent(data: V2XWarningTarget) { @@ -335,17 +296,6 @@ object V2XEventManager : IMoGoChassisLocationGCJ02Listener, IMoGoTokenCallback, } } - private fun handleOptimalRouteEvent(event: V2XEvent.OptimalRoute) { - val v2xMessageEntity: V2XMessageEntity = - V2XMessageEntity() // 控制类型 - v2xMessageEntity.type = V2XMessageEntity.V2XTypeEnum.ALERT_PUSH_VR_SHOW // 设置数据 - v2xMessageEntity.content = event.data // 控制展示状态 - v2xMessageEntity.isShowState = true - val intent = Intent(BROADCAST_SCENE_HANDLER_ACTION) - intent.putExtra(BROADCAST_SCENE_EXTRA_KEY, v2xMessageEntity) - LocalBroadcastManager.getInstance(Utils.getApp()).sendBroadcast(intent) - } - private fun handleAdvanceWarningEvent(event: V2XEvent.ForwardsWarning) { scope.launch { val message = event.data @@ -375,12 +325,10 @@ object V2XEventManager : IMoGoChassisLocationGCJ02Listener, IMoGoTokenCallback, } 1003 -> { // 交叉路口碰撞预警 - /* - TODO xiaopeng 先注掉,编译通过 changeVisualAngle = true tempAppId = EventTypeEnumNew.TYPE_USECASE_ID_ICW.poiType.toInt() tempTts = EventTypeEnumNew.TYPE_USECASE_ID_ICW.tts - tempContent = EventTypeEnumNew.TYPE_USECASE_ID_ICW.content*/ + tempContent = EventTypeEnumNew.TYPE_USECASE_ID_ICW.content } 1004 -> { // 交叉路口碰撞预警 @@ -422,7 +370,7 @@ object V2XEventManager : IMoGoChassisLocationGCJ02Listener, IMoGoTokenCallback, } } // 不显示弹框,其它保留 - if (tempContent.isNullOrEmpty() || tempTts.isNullOrEmpty()) { + if (tempContent.isEmpty() || tempTts.isEmpty()) { Log.d("MsgBox-V2XEventManager", "alertContent或ttsContent为空!") } CallerMsgBoxManager.saveMsgBox( diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/alarm/V2XAlarmServer.java b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/alarm/V2XAlarmServer.java index c4f2ca6de0..386e2116ec 100644 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/alarm/V2XAlarmServer.java +++ b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/alarm/V2XAlarmServer.java @@ -6,6 +6,7 @@ import com.mogo.eagle.core.data.enums.EventTypeEnumNew; import com.mogo.eagle.core.data.map.MogoLocation; import com.mogo.eagle.core.data.map.entity.MarkerLocation; import com.mogo.eagle.core.data.map.entity.V2XRoadEventEntity; +import com.mogo.eagle.core.utilcode.mogo.logger.Logger; import com.mogo.eagle.core.utilcode.util.DrivingDirectionUtils; import java.util.Iterator; @@ -27,6 +28,8 @@ import io.netty.util.internal.ConcurrentSet; */ public class V2XAlarmServer { + private static final String TAG = "V2XAlarmServer"; + // 记录道路播报的事件 private static final ConcurrentSet showedEvents = new ConcurrentSet<>(); /** @@ -36,7 +39,7 @@ public class V2XAlarmServer { CopyOnWriteArrayList v2XRoadEventEntityList, MogoLocation currentLocation) { try { - Log.d("RWJ", "getDriveFrontAlarmEvent --- 1 ---" + currentLocation ); + Logger.d(TAG, "getDriveFrontAlarmEvent --- 1 ---" + currentLocation ); if (!showedEvents.isEmpty()) { Iterator iterator = showedEvents.iterator(); while (iterator.hasNext()) { @@ -53,18 +56,18 @@ public class V2XAlarmServer { } } } - Log.d("RWJ", "getDriveFrontAlarmEvent --- 2 ---" + currentLocation); + Logger.d(TAG, "getDriveFrontAlarmEvent --- 2 ---" + currentLocation); if (currentLocation != null && v2XRoadEventEntityList != null) { // 因为集合是按照距离排序后的所以这里检索出来第一个就发出警告 for (V2XRoadEventEntity v2XRoadEventEntity : v2XRoadEventEntityList) { // 0、道路事件必须有朝向,角度>=0; - Log.d("RWJ", "entity:" + v2XRoadEventEntity.getLocation()); + Logger.d(TAG, "entity:" + v2XRoadEventEntity.getLocation()); if (v2XRoadEventEntity.getLocation().getAngle() >= 0) { // 计算车辆距离指定气泡的距离 MarkerLocation eventLocation = v2XRoadEventEntity.getLocation(); // 1、判断是否到达了触发距离,20 ~ 500, double distance = v2XRoadEventEntity.getDistance(); - Log.d("RWJ", "distance:" + distance); + Logger.d(TAG, "distance:" + distance); if (distance <= 500) { if (EventTypeEnumNew.GHOST_PROBE.getPoiType().equals(v2XRoadEventEntity.getPoiType())) { if (distance > 25) { @@ -75,7 +78,7 @@ public class V2XAlarmServer { double carBearing = currentLocation.getBearing(); double eventBearing = eventLocation.getAngle(); double diffAngle = DrivingDirectionUtils.getAngleDiff(carBearing, eventBearing); - Log.d("RWJ", "car_bearing:" + carBearing + ",eventBearing:" + eventBearing + ",diffAngle:" + diffAngle); + Logger.d(TAG, "car_bearing:" + carBearing + ",eventBearing:" + eventBearing + ",diffAngle:" + diffAngle); if (diffAngle <= 20) { // 3、计算当前车辆行驶方向与事件位置之间夹角《20度,保证道路事件在车辆前方 double eventAngle = DrivingDirectionUtils.getDegreeOfCar2Poi( @@ -86,12 +89,12 @@ public class V2XAlarmServer { (int) currentLocation.getBearing() ); - Log.d("RWJ", "eventAngle:" + eventAngle); + Logger.d(TAG, "eventAngle:" + eventAngle); if (0 <= eventAngle && eventAngle <= 20) { if (showedEvents.contains(v2XRoadEventEntity)) { return null; } - Log.d("RWJ", "showed---"); + Logger.d(TAG, "showed---"); showedEvents.add(v2XRoadEventEntity); return v2XRoadEventEntity; } @@ -102,7 +105,7 @@ public class V2XAlarmServer { } } catch (Exception e) { e.printStackTrace(); - Log.w("RWJ", "error: " + e.getMessage()); + Logger.w(TAG, "error: " + e.getMessage()); } return null; } diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/bridge/BridgeApi.kt b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/bridge/BridgeApi.kt index 566587fc86..8a9b602209 100644 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/bridge/BridgeApi.kt +++ b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/bridge/BridgeApi.kt @@ -23,10 +23,6 @@ internal object BridgeApi { ARouter.getInstance().build(MoGoV2XServicePaths.PATH_V2X_MARKER_MANAGER).navigation(context()) as? IMoGoV2XMarkerManager } - private val v2xPolyline by lazy { - ARouter.getInstance().build(MoGoV2XServicePaths.PATH_V2X_POLYLINE_MANAGER).navigation(context()) as? IMoGoV2XPolylineManager - } - private val v2xWarnPolyline by lazy { ARouter.getInstance().build(MoGoV2XServicePaths.PATH_V2X_WARN_POLYLINE_MANAGER).navigation(context()) as? IMoGoWarnPolylineManager } @@ -39,10 +35,6 @@ internal object BridgeApi { ARouter.getInstance().build(MoGoV2XServicePaths.PATH_V2X_STOP_POLYLINE_MANAGER).navigation(context()) as? IMoGoStopPolylineManager } - private val v2xStatus by lazy { - ARouter.getInstance().build(MoGoV2XServicePaths.PATH_V2X_STATUS_MANAGER).navigation(context()) as? IMoGoV2XStatusManager - } - fun init(context: Context) { this.context.set(WeakReference(context)) } @@ -51,14 +43,9 @@ internal object BridgeApi { fun v2xMarker() = v2xMarker - fun v2xPolyline() = v2xPolyline - fun v2xWarnPolyline() = v2xWarnPolyline fun v2xPersonWarnPolyline() = v2xPersonWarnPolyline fun v2xStopPolyline() = v2xStopPolyline - - fun v2xStatus() = v2xStatus - } \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/manager/IMoGoV2XMarkerManager.java b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/manager/IMoGoV2XMarkerManager.java index f82f7c4014..fdfe8dec63 100644 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/manager/IMoGoV2XMarkerManager.java +++ b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/manager/IMoGoV2XMarkerManager.java @@ -19,11 +19,6 @@ import java.util.concurrent.CopyOnWriteArrayList; */ public interface IMoGoV2XMarkerManager extends IProvider { - /** - * 重新绘制最后一次的POI点 - */ - void drawableLastAllPOI(); - /** * 获取所有的道路事件点,探路事件,返回结果是按照距离当前车辆从近到远排列好的 * @@ -43,20 +38,4 @@ public interface IMoGoV2XMarkerManager extends IProvider { * @return */ IMogoMarker drawableAlarmPOI(Context context, V2XRoadEventEntity roadEventEntity, IMogoMarkerClickListener clickListener); - - /** - * 清除 道路事件 POI - */ - void clearAlarmPOI(); - - /** - * 清除 所有的 POI - */ - void clearALLPOI(); - - - /** - * 强制清除道路事件POI - */ - void forceClearAlarmPOI(); } diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/manager/IMoGoV2XPolylineManager.java b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/manager/IMoGoV2XPolylineManager.java deleted file mode 100644 index 00ccb22e7a..0000000000 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/manager/IMoGoV2XPolylineManager.java +++ /dev/null @@ -1,31 +0,0 @@ -package com.mogo.eagle.core.function.v2x.events.manager; - -import android.content.Context; - -import com.alibaba.android.arouter.facade.template.IProvider; -import com.mogo.eagle.core.data.map.entity.V2XRoadEventEntity; -import com.mogo.map.overlay.IMogoPolyline; - -/** - * author : donghongyu - * e-mail : 1358506549@qq.com - * date : 2020/4/17 9:49 PM - * desc : 当前车辆与道路事件的连接线 - * version: 1.0 - */ -public interface IMoGoV2XPolylineManager extends IProvider { - /** - * 绘制连接线,目标车,与当前车辆间连线 - * - * @param context - * @param roadEventEntity - */ - void drawablePolyline(Context context, V2XRoadEventEntity roadEventEntity); - - /** - * 移除连接线 - */ - void clearLine(); - - IMogoPolyline getMogoPolyline(); -} diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/manager/IMoGoV2XStatusChangedListener.java b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/manager/IMoGoV2XStatusChangedListener.java deleted file mode 100644 index 964ce81d76..0000000000 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/manager/IMoGoV2XStatusChangedListener.java +++ /dev/null @@ -1,19 +0,0 @@ -package com.mogo.eagle.core.function.v2x.events.manager; - -import com.alibaba.android.arouter.facade.template.IProvider; - -/** - * author : donghongyu - * e-mail : 1358506549@qq.com - * date : 2020/4/17 7:44 PM - * desc : 状态控制器监听 - * version: 1.0 - */ -public interface IMoGoV2XStatusChangedListener extends IProvider { - - /** - * @param descriptor 状态类型 - * @param isTrue true - v2x ui show - */ - void onStatusChanged(V2XStatusDescriptor descriptor, boolean isTrue); -} diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/manager/IMoGoV2XStatusManager.java b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/manager/IMoGoV2XStatusManager.java deleted file mode 100644 index 473b65bf7b..0000000000 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/manager/IMoGoV2XStatusManager.java +++ /dev/null @@ -1,34 +0,0 @@ -package com.mogo.eagle.core.function.v2x.events.manager; - -import com.alibaba.android.arouter.facade.template.IProvider; - -/** - * author : donghongyu - * e-mail : 1358506549@qq.com - * date : 2020/4/17 7:20 PM - * desc : V2X 状态管理 - * version: 1.0 - */ -public interface IMoGoV2XStatusManager extends IProvider { - /** - * 地图区域 V2X道路预警POI 是否在展示 - */ - boolean isRoadEventPOIShow(); - - /** - * 设置 V2X道路预警POI 是否在展示 - * - * @param tag - * @param show - */ - void setRoadEventPOIShow(String tag, boolean show); - - /** - * 地图区域 推送的 POI 是否在展示 - * - * @param tag - * @param show - */ - void setPushPOIShow(String tag, boolean show); - -} diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/manager/V2XStatusDescriptor.java b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/manager/V2XStatusDescriptor.java deleted file mode 100644 index 2174ed12c4..0000000000 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/manager/V2XStatusDescriptor.java +++ /dev/null @@ -1,70 +0,0 @@ -package com.mogo.eagle.core.function.v2x.events.manager; - -/** - * @author congtaowang - * @since 2020-01-04 - *

- * 状态描述 - */ -public enum V2XStatusDescriptor { - - /** - * 地图 V2X道路预警POI - */ - RoadEventPOI_UI, - - /** - * 按钮 V2X道路预警 - */ - RoadEventButton_UI, - - /** - * 头部 V2X道路预警 UI - */ - RoadEventWindow_UI, - - /** - * 头部 V2X的道路直播 UI - */ - RoadLiveCarWindow_UI, - - /** - * 地图 他人车辆故障求助POI - */ - OtherSeekHelpPOI_UI, - - /** - * 头部 他人车辆故障求助 UI 是否在展示 - */ - OtherSeekHelpWindow_UI, - - /** - * 右侧2/3 V2X 场景动画 UI 是否在展示 - */ - V2XAnimationWindow_UI, - - /** - * 右侧2/3 左下角 模拟直播车机 UI 是否在展示 - */ - LiveCarWindow_UI, - - /** - * 右侧2/3 左下角 模拟直播车机 UI 是否在展示 - */ - V2XRoadVideo_UI, - - /** - * 推送的POI - */ - PushWindowPOI_UI, - - /** - * 推送的弹窗 - */ - PushWindow_UI, - - /** - * 疲劳驾驶弹窗 - */ - FatigueDrivingWindow_UI -} diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/manager/V2XStatusManager.java b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/manager/V2XStatusManager.java deleted file mode 100644 index 541a2090a7..0000000000 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/manager/V2XStatusManager.java +++ /dev/null @@ -1,61 +0,0 @@ -package com.mogo.eagle.core.function.v2x.events.manager; - -import com.mogo.eagle.core.data.map.MogoLatLng; -import com.mogo.eagle.core.data.map.MogoLocation; -import com.mogo.eagle.core.data.map.entity.V2XRoadEventEntity; - -/** - * author : donghongyu - * e-mail : 1358506549@qq.com - * date : 2020/4/3 2:34 PM - * desc : V2X状态管理 - * version: 1.0 - */ -public class V2XStatusManager { - private static V2XStatusManager mV2XStatusManager; - // 正在进行的告警事件详情 - private V2XRoadEventEntity mAlarmInfo; - - private MogoLocation mLocation; - - private V2XStatusManager() { - } - - /** - * 获取操作实体 - */ - public static synchronized V2XStatusManager getInstance() { - synchronized (V2XStatusManager.class) { - if (mV2XStatusManager == null) { - mV2XStatusManager = new V2XStatusManager(); - } - } - return mV2XStatusManager; - } - - public void setAlarmInfo(V2XRoadEventEntity eventEntity) { - this.mAlarmInfo = eventEntity; - } - - // 获取目标事件经纬度 - public MogoLatLng getTargetMoGoLatLng() { - if (mAlarmInfo != null) { - return new MogoLatLng( - mAlarmInfo.getLocation().getLat(), - mAlarmInfo.getLocation().getLon() - ); - } - return null; - } - - public MogoLocation getLocation() { - if (mLocation == null) { - mLocation = new MogoLocation(); - } - return mLocation; - } - - public void setLocation(MogoLocation mLocation) { - this.mLocation = mLocation; - } -} diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/manager/impl/MoGoV2XMarkerManager.java b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/manager/impl/MoGoV2XMarkerManager.java index ffa58677e6..627ddfed5d 100644 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/manager/impl/MoGoV2XMarkerManager.java +++ b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/manager/impl/MoGoV2XMarkerManager.java @@ -1,15 +1,10 @@ package com.mogo.eagle.core.function.v2x.events.manager.impl; import static com.mogo.commons.module.ServiceConst.CARD_TYPE_NOVELTY; -import static com.mogo.eagle.core.function.v2x.events.consts.V2XConst.V2X_EVENT_ALARM_POI; import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_V2X; - import android.content.Context; - import com.alibaba.android.arouter.facade.annotation.Route; import com.mogo.cloud.commons.utils.CoordinateUtils; -import com.mogo.commons.AbsMogoApplication; -import com.mogo.commons.module.status.MogoStatusManager; import com.mogo.eagle.core.data.enums.EventTypeEnumNew; import com.mogo.eagle.core.data.map.MogoLatLng; import com.mogo.eagle.core.data.map.MogoLocation; @@ -17,26 +12,20 @@ import com.mogo.eagle.core.data.map.entity.MarkerExploreWay; import com.mogo.eagle.core.data.map.entity.MarkerLocation; import com.mogo.eagle.core.data.map.entity.MarkerShowEntity; import com.mogo.eagle.core.data.map.entity.V2XRoadEventEntity; +import com.mogo.eagle.core.function.call.map.CallerMapLocationListenerManager; import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager; -import com.mogo.eagle.core.function.v2x.events.bridge.BridgeApi; import com.mogo.eagle.core.function.v2x.events.consts.MoGoV2XServicePaths; import com.mogo.eagle.core.function.v2x.events.manager.IMoGoV2XMarkerManager; -import com.mogo.eagle.core.function.v2x.events.manager.IMoGoV2XPolylineManager; -import com.mogo.eagle.core.function.v2x.events.manager.IMoGoV2XStatusManager; -import com.mogo.eagle.core.function.v2x.events.manager.V2XStatusManager; import com.mogo.eagle.core.function.v2x.events.marker.V2XMarkerAdapter; import com.mogo.eagle.core.function.v2x.events.utils.EntityUtilsKt; import com.mogo.eagle.core.function.v2x.events.utils.MapUtils; -import com.mogo.eagle.core.function.v2x.internal.V2XManager; import com.mogo.eagle.core.function.v2x.internal.data.V2XMarkerCardResult; import com.mogo.eagle.core.function.v2x.internal.data.V2XMarkerExploreWay; import com.mogo.eagle.core.function.v2x.internal.data.V2XMarkerLocation; import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger; import com.mogo.map.marker.IMogoMarker; import com.mogo.map.marker.IMogoMarkerClickListener; -import com.mogo.map.marker.IMogoMarkerManager; import com.mogo.map.marker.MogoMarkerOptions; - import java.util.List; import java.util.Objects; import java.util.concurrent.CopyOnWriteArrayList; @@ -54,25 +43,16 @@ public class MoGoV2XMarkerManager implements IMoGoV2XMarkerManager { private static final String TAG = "MoGoV2XMarkerManager"; // 记录所有的:新鲜事儿的道路事件点、探路事件 - private static final CopyOnWriteArraySet mV2XRoadEventEntityArrayList = new CopyOnWriteArraySet<>(); - + private final CopyOnWriteArraySet mV2XRoadEventEntityArrayList = new CopyOnWriteArraySet<>(); @Override - public void drawableLastAllPOI() { - // 清除连接线 - IMoGoV2XPolylineManager polylineManager = BridgeApi.INSTANCE.v2xPolyline(); - if (polylineManager != null) { - polylineManager.clearLine(); - } - clearAlarmPOI(); - V2XManager.INSTANCE.forceRefresh(); - } + public void init(Context context) {} @Override public CopyOnWriteArrayList getV2XRoadEventEntityList() { CopyOnWriteArrayList roadEventEntities = new CopyOnWriteArrayList<>(); // 当前车辆数据 - MogoLocation currentLocation = V2XStatusManager.getInstance().getLocation(); + MogoLocation currentLocation = CallerMapLocationListenerManager.INSTANCE.getCurrentLocation(); if (currentLocation != null) { // 重新计算距离 for (V2XRoadEventEntity v2XRoadEventEntity : mV2XRoadEventEntityArrayList) { @@ -133,12 +113,7 @@ public class MoGoV2XMarkerManager implements IMoGoV2XMarkerManager { @Override public IMogoMarker drawableAlarmPOI(Context context, V2XRoadEventEntity roadEventEntity, IMogoMarkerClickListener clickListener) { try { - IMoGoV2XStatusManager v2xStatus = BridgeApi.INSTANCE.v2xStatus(); - if (v2xStatus != null) { - v2xStatus.setRoadEventPOIShow(TAG, true); - } // 清除原来的大而全的新鲜事儿 - clearAlarmPOI(); if (roadEventEntity.getLocation() != null) { // 道路事件,或者水波纹扩散效果 MogoMarkerOptions optionsRipple = new MogoMarkerOptions() @@ -155,25 +130,11 @@ public class MoGoV2XMarkerManager implements IMoGoV2XMarkerManager { markerShowEntity.setMarkerType(CARD_TYPE_NOVELTY); optionsRipple.icons(V2XMarkerAdapter.getV2XRoadEventViewGif(context, roadEventEntity)); optionsRipple.period(1); - IMogoMarker ret = null; - if (MogoStatusManager.getInstance().isVrMode()) { - ret = Objects.requireNonNull(CallerMapUIServiceManager.INSTANCE.getMarkerService()).drawMarker(markerShowEntity); - } else { - optionsRipple.icon(V2XMarkerAdapter.getV2XRoadEventViewPng(context, roadEventEntity)); - IMogoMarkerManager marker = CallerMapUIServiceManager.INSTANCE.getMarkerManager(context); - if (marker != null) { - ret = marker.addMarker(V2X_EVENT_ALARM_POI, optionsRipple); - } - } + IMogoMarker ret = Objects.requireNonNull(CallerMapUIServiceManager.INSTANCE.getMarkerService()).drawMarker(markerShowEntity); // 当前Marker设置为最上面 if (ret != null) { ret.setToTop(); } - // 绘制连接线 - IMoGoV2XPolylineManager polylineManager = BridgeApi.INSTANCE.v2xPolyline(); - if (polylineManager != null) { - polylineManager.drawablePolyline(context, roadEventEntity); - } // 缩放地图 MapUtils.zoomMap( new MogoLatLng(roadEventEntity.getLocation().getLat(), @@ -189,43 +150,4 @@ public class MoGoV2XMarkerManager implements IMoGoV2XMarkerManager { } return null; } - - @Override - public void clearAlarmPOI() { -// boolean isRoadEventPOIShow = false; -// IMoGoV2XStatusManager v2xStatus = BridgeApi.INSTANCE.v2xStatus(); -// if (v2xStatus != null) { -// isRoadEventPOIShow = v2xStatus.isRoadEventPOIShow(); -// } -// if (isRoadEventPOIShow) { -// v2xStatus.setRoadEventPOIShow(TAG, false); -// if (mAlarmInfoMarker != null) { -// mAlarmInfoMarker.remove(); -// } -// } - } - - @Override - public void clearALLPOI() { - try { - IMogoMarkerManager markerManager = CallerMapUIServiceManager.INSTANCE.getMarkerManager(AbsMogoApplication.getApp()); - if (markerManager != null) { - markerManager.removeMarkers(); - } - } catch (Exception e) { - e.printStackTrace(); - } - } - - @Override - public void forceClearAlarmPOI() { -// if (mAlarmInfoMarker != null) { -// mAlarmInfoMarker.remove(); -// } - } - - @Override - public void init(Context context) { - - } } diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/manager/impl/MoGoV2XPolylineManager.java b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/manager/impl/MoGoV2XPolylineManager.java deleted file mode 100644 index 91318099b4..0000000000 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/manager/impl/MoGoV2XPolylineManager.java +++ /dev/null @@ -1,114 +0,0 @@ -package com.mogo.eagle.core.function.v2x.events.manager.impl; - -import android.content.Context; - -import com.alibaba.android.arouter.facade.annotation.Route; -import com.mogo.eagle.core.data.map.entity.V2XRoadEventEntity; -import com.mogo.eagle.core.function.v2x.events.consts.MoGoV2XServicePaths; -import com.mogo.eagle.core.function.v2x.events.manager.IMoGoV2XPolylineManager; -import com.mogo.eagle.core.function.v2x.events.manager.V2XStatusManager; -import com.mogo.map.overlay.IMogoPolyline; - -/** - * author : donghongyu - * e-mail : 1358506549@qq.com - * date : 2020/4/17 10:00 PM - * desc : 当前车辆与道路事件的连接线 - * version: 1.0 - */ -@Route(path = MoGoV2XServicePaths.PATH_V2X_POLYLINE_MANAGER) -public class MoGoV2XPolylineManager implements IMoGoV2XPolylineManager { - private static final String TAG = "MoGoV2XPolylineManager"; - private static IMogoPolyline mMogoPolyline; - - @Override - public void drawablePolyline(Context context, V2XRoadEventEntity roadEventEntity) { -// try { -// if (mMogoPolyline != null) { -// mMogoPolyline.remove(); -// } -// boolean isRoadEventPOIShow = false; -// boolean isOtherSeekHelpPOIShow = false; -// IMoGoV2XStatusManager v2xStatus = BridgeApi.INSTANCE.v2xStatus(); -// if (v2xStatus != null) { -// isRoadEventPOIShow = v2xStatus.isRoadEventPOIShow(); -// isOtherSeekHelpPOIShow = v2xStatus.isOtherSeekHelpPOIShow(); -// } -// boolean isVrMode = false; -// IMogoStatusManager statusManager = BridgeApi.INSTANCE.statusManager(); -// if (statusManager != null) { -// isVrMode = statusManager.isVrMode(); -// } - -// if ((isRoadEventPOIShow -// || isOtherSeekHelpPOIShow) -// && V2XStatusManager.getInstance().getTargetMoGoLatLng() != null -// && !isVrMode -// ) { -// // 连接线参数 -// MogoPolylineOptions options = new MogoPolylineOptions().setGps(true); -// -// // 渐变色 -// List colors = new ArrayList<>(); -// -// if (EventTypeEnum.ALERT_TRAFFIC_LIGHT_SUGGEST.getPoiType().equals(roadEventEntity.getPoiType()) -// || EventTypeEnum.ALERT_TRAFFIC_LIGHT_WARNING.getPoiType().equals(roadEventEntity.getPoiType()) -// || EventTypeEnum.FOURS_BLOCK_UP.getPoiType().equals(roadEventEntity.getPoiType()) -// || EventTypeEnum.ALERT_CAR_TROUBLE_WARNING.getPoiType().equals(roadEventEntity.getPoiType())) { -// colors.add(0xFFFFA31A); -// colors.add(0xFFFFA31A); -// } else { -// colors.add(0xFFE32F46); -// colors.add(0xFFE32F46); -// } -// // 线条粗细,渐变,渐变色值 -// options.width(10).useGradient(true).colorValues(colors); -// -// // 当前车辆位置 -// MogoLatLng carLocation = new MogoLatLng( -// CallerAutoPilotStatusListenerManager.INSTANCE.getCurWgs84Lat(), -// CallerAutoPilotStatusListenerManager.INSTANCE.getCurWgs84Lon() -// ); -// -// if (carLocation != null) { -// options.add(carLocation); -// } else { -// options.add(V2XStatusManager.getInstance().getLocation()); -// } -// // 目标车辆、道路事件位置 -// options.add(V2XStatusManager.getInstance().getTargetMoGoLatLng()); -// -// // 绘制线的对象 -// IMogoOverlayManager overlay = MogoOverlayManager.getInstance(); -// if (overlay != null) { -// mMogoPolyline = overlay.addPolyline(options); -// } -// } -// } catch (Exception e) { -// e.printStackTrace(); -// } - } - - @Override - public void clearLine() { - if (mMogoPolyline != null) { - mMogoPolyline.remove(); - mMogoPolyline = null; - V2XStatusManager.getInstance().setAlarmInfo(null); - } - } - - @Override - public void init(Context context) { - - } - - /** - * @return 绘制连接线的对象 - */ - @Override - public IMogoPolyline getMogoPolyline() { - return mMogoPolyline; - } - -} diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/manager/impl/MoGoV2XStatusManager.java b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/manager/impl/MoGoV2XStatusManager.java deleted file mode 100644 index 9f04357bb1..0000000000 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/manager/impl/MoGoV2XStatusManager.java +++ /dev/null @@ -1,100 +0,0 @@ -package com.mogo.eagle.core.function.v2x.events.manager.impl; - -import android.content.Context; - -import com.alibaba.android.arouter.facade.annotation.Route; -import com.mogo.eagle.core.function.v2x.events.consts.MoGoV2XServicePaths; -import com.mogo.eagle.core.function.v2x.events.manager.IMoGoV2XStatusChangedListener; -import com.mogo.eagle.core.function.v2x.events.manager.IMoGoV2XStatusManager; -import com.mogo.eagle.core.function.v2x.events.manager.V2XStatusDescriptor; - -import java.util.List; -import java.util.Map; -import java.util.concurrent.ConcurrentHashMap; - -/** - * author : donghongyu - * e-mail : 1358506549@qq.com - * date : 2020/4/17 7:34 PM - * desc : - * version: 1.0 - */ -@Route(path = MoGoV2XServicePaths.PATH_V2X_STATUS_MANAGER) -public class MoGoV2XStatusManager implements IMoGoV2XStatusManager { - private static final String TAG = "MoGoV2XStatusManager"; - - /** - * 状态记录 - */ - private static final Map mStatus = new ConcurrentHashMap<>(); - - /** - * 回调集合 - */ - private static final Map> mListeners = new ConcurrentHashMap<>(); - - /** - * 状态类型修改记录 - */ - private static final Map mModifier = new ConcurrentHashMap<>(); - - // 查询状态存储情况 - private boolean get_bool_val(V2XStatusDescriptor descriptor) { - Boolean val = mStatus.get(descriptor); - return val == null ? false : val; - } - - @Override - public boolean isRoadEventPOIShow() { - return get_bool_val(V2XStatusDescriptor.RoadEventPOI_UI); - } - - @Override - public void setRoadEventPOIShow(String tag, boolean show) { - mStatus.put(V2XStatusDescriptor.RoadEventPOI_UI, show); - invokeStatusChangedListener(V2XStatusDescriptor.RoadEventPOI_UI, show); - recordStatusModifier(tag, V2XStatusDescriptor.RoadEventPOI_UI); - } - - - @Override - public void setPushPOIShow(String tag, boolean show) { - mStatus.put(V2XStatusDescriptor.PushWindowPOI_UI, show); - invokeStatusChangedListener(V2XStatusDescriptor.PushWindowPOI_UI, show); - recordStatusModifier(tag, V2XStatusDescriptor.PushWindowPOI_UI); - } - - /** - * 调用所有存储的监听 - * - * @param descriptor - * @param status - */ - private void invokeStatusChangedListener(V2XStatusDescriptor descriptor, boolean status) { - if (mListeners.containsKey(descriptor)) { - List listeners = mListeners.get(descriptor); - if (listeners != null) { - for (IMoGoV2XStatusChangedListener listener : listeners) { - if (listener != null) { - listener.onStatusChanged(descriptor, status); - } - } - } - } - } - - /** - * 记录状态 - * - * @param tag - * @param descriptor - */ - private void recordStatusModifier(String tag, V2XStatusDescriptor descriptor) { - mModifier.put(descriptor, tag); - } - - @Override - public void init(Context context) { - - } -} diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/marker/V2XMarkerAdapter.java b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/marker/V2XMarkerAdapter.java index eb6107c2db..12a6e872f0 100644 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/marker/V2XMarkerAdapter.java +++ b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/marker/V2XMarkerAdapter.java @@ -2,12 +2,10 @@ package com.mogo.eagle.core.function.v2x.events.marker; import android.content.Context; import android.graphics.Bitmap; - import com.mogo.eagle.core.data.enums.EventTypeEnumNew; import com.mogo.eagle.core.data.map.entity.V2XRoadEventEntity; import com.mogo.eagle.core.function.v2x.R; import com.mogo.eagle.core.function.v2x.events.view.V2XMarkerRoadEventView; - import java.util.ArrayList; /** @@ -26,28 +24,6 @@ public class V2XMarkerAdapter { return new V2XMarkerRoadEventView(context, alarmInfo).setBackground(imageRes).getView(); } - /** - * 返回道路事件静态的图,因为车机性能不行,会卡顿 - */ - public static Bitmap getV2XRoadEventViewPng(Context context, V2XRoadEventEntity alarmInfo) { - Bitmap bitmap; - if (EventTypeEnumNew.ALERT_TRAFFIC_LIGHT_SUGGEST.getPoiType().equals(alarmInfo.getPoiType()) - || EventTypeEnumNew.ALERT_TRAFFIC_LIGHT_WARNING.getPoiType().equals(alarmInfo.getPoiType()) - || EventTypeEnumNew.FOURS_BLOCK_UP.getPoiType().equals(alarmInfo.getPoiType()) - || EventTypeEnumNew.ALERT_CAR_TROUBLE_WARNING.getPoiType().equals(alarmInfo.getPoiType())) { - bitmap = getV2XRoadEventMarkerView( - context, - alarmInfo, - R.drawable.v_to_x_warning_circle_orange_00040); - } else { - bitmap = getV2XRoadEventMarkerView( - context, - alarmInfo, - R.drawable.v_to_x_warning_circle_red_00040); - } - return bitmap; - } - /** * 返回道路事件gif序列图集合 */ diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/observer/CarLocationObserver.java b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/observer/CarLocationObserver.java deleted file mode 100644 index 06e910f8e9..0000000000 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/observer/CarLocationObserver.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.mogo.eagle.core.function.v2x.events.observer; - -import com.mogo.eagle.core.data.map.MogoLocation; - -/** - * @author donghongyu - * @date 4/9/21 2:14 PM - * 当前车辆位置观察者接口 - */ -public abstract class CarLocationObserver { - // 更新状态 - public abstract void update(MogoLocation carLocation); -} diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/observer/V2XOptimalRouteObserver.java b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/observer/V2XOptimalRouteObserver.java deleted file mode 100644 index a67b45437a..0000000000 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/observer/V2XOptimalRouteObserver.java +++ /dev/null @@ -1,50 +0,0 @@ -package com.mogo.eagle.core.function.v2x.events.observer; - -import com.mogo.eagle.core.data.map.MogoLatLng; -import com.mogo.eagle.core.data.map.MogoLocation; -import com.mogo.eagle.core.function.v2x.events.overlay.V2XOptimalRouteOverlay; -import java.util.List; - -/** - * @author donghongyu - * @date 4/9/21 2:38 PM - * 最优路线推荐 - */ -public class V2XOptimalRouteObserver extends CarLocationObserver { - public static String TYPE = "V2XOptimalRouteObserver"; - - private static V2XOptimalRouteObserver v2XOptimalRouteObserver; - //最优路线覆盖物绘制 - private V2XOptimalRouteOverlay mV2XOptimalRouteOverlay; - // 要绘制的数据 - private List polylinePoint; - - public static V2XOptimalRouteObserver getInstance() { - if (v2XOptimalRouteObserver == null) { - synchronized (V2XOptimalRouteObserver.class) { - if (v2XOptimalRouteObserver == null) { - v2XOptimalRouteObserver = new V2XOptimalRouteObserver(); - } - } - } - return v2XOptimalRouteObserver; - } - - private V2XOptimalRouteObserver() { - mV2XOptimalRouteOverlay = new V2XOptimalRouteOverlay(); - } - - /** - * 设置推荐路线 - * - * @param polylinePoint 推荐的路线 - */ - public void setPolylinePoint(List polylinePoint) { - this.polylinePoint = polylinePoint; - } - - @Override - public void update(MogoLocation carLocation) { - mV2XOptimalRouteOverlay.draw(carLocation, polylinePoint); - } -} diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/overlay/V2XOptimalRouteOverlay.java b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/overlay/V2XOptimalRouteOverlay.java deleted file mode 100644 index d922119aff..0000000000 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/overlay/V2XOptimalRouteOverlay.java +++ /dev/null @@ -1,77 +0,0 @@ -package com.mogo.eagle.core.function.v2x.events.overlay; - -import com.mogo.commons.AbsMogoApplication; -import com.mogo.eagle.core.data.map.MogoLatLng; -import com.mogo.eagle.core.data.map.MogoLocation; -import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager; -import com.mogo.commons.utils.LocationUtils; -import com.mogo.eagle.core.utilcode.util.ColorUtils; -import com.mogo.map.overlay.IMogoOverlayManager; -import com.mogo.map.overlay.IMogoPolyline; -import com.mogo.map.overlay.MogoPolylineOptions; - -import java.util.ArrayList; -import java.util.List; - -/** - * 最优路线推荐的图覆盖物 - * - * @author donghongyu - * @date 4/8/21 6:06 PM - */ -public class V2XOptimalRouteOverlay { - private IMogoPolyline mMoGoPolyline; - // 连接线参数 - private MogoPolylineOptions mPolylineOptions; - // 线路径集合 - private List mPolylinePointList; - // 渐变色 - private List mPolylineColors; - - public V2XOptimalRouteOverlay() { - mPolylineOptions = new MogoPolylineOptions(); - // 绘制路径集合 - mPolylinePointList = new ArrayList<>(); - // 引导线颜色 - mPolylineColors = new ArrayList<>(); - } - - /** - * 绘制最优路线 - * - * @param polylinePoint 要绘制的经纬度度集合 - */ - public IMogoPolyline draw(MogoLocation carLocal, List polylinePoint) { - if (mMoGoPolyline != null) { - mMoGoPolyline.remove(); - mPolylinePointList.clear(); - mPolylineColors.clear(); - } - if (polylinePoint != null) { - - // 将当前车辆位置放进去 - mPolylinePointList.add(new MogoLatLng(carLocal.getLatitude(), carLocal.getLongitude())); - // 过滤后台推送的推荐路线集合 - for (MogoLatLng polyline : polylinePoint) { - //需要剔除已经行驶过的经纬度,这里需要比对推荐路线集合中的点是否在当前车辆行驶方向前面如果不在则抛弃 - if (LocationUtils.isPointOnCarFront(carLocal, polyline)) { - mPolylinePointList.add(polyline); - } - } - - mPolylineColors.addAll(ColorUtils.getGradientAlpha("#002965ED", "#FF2965ED", "#002965ED", mPolylinePointList.size())); - - // 替换路径集合 - mPolylineOptions.points(mPolylinePointList); - // 线条粗细,渐变,渐变色值 - mPolylineOptions.width(25).useGradient(true).colorValues(mPolylineColors); - // 绘制线 - IMogoOverlayManager overlay = CallerMapUIServiceManager.INSTANCE.getOverlayManager(AbsMogoApplication.getApp()); - if (overlay != null) { - mMoGoPolyline = overlay.addPolyline(mPolylineOptions); - } - } - return mMoGoPolyline; - } - -} diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/marker/MarkerManager.kt b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/remove/MarkerRemoveManager.kt similarity index 98% rename from core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/marker/MarkerManager.kt rename to core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/remove/MarkerRemoveManager.kt index f738b3ab34..238af1abca 100644 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/marker/MarkerManager.kt +++ b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/remove/MarkerRemoveManager.kt @@ -1,4 +1,4 @@ -package com.mogo.eagle.core.function.v2x.events.marker +package com.mogo.eagle.core.function.v2x.events.remove import android.os.Handler import android.os.HandlerThread @@ -52,7 +52,7 @@ data class MarkerWrapper(val id: String, val lon: Double, val lat: Double, val c } } -object MarkerManager { +object MarkerRemoveManager { private const val TAG = "MarkerManager" diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/impl/V2XScenarioManager.java b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/impl/V2XScenarioManager.java index 1928101ce5..1f43cac2e9 100644 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/impl/V2XScenarioManager.java +++ b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/impl/V2XScenarioManager.java @@ -13,7 +13,6 @@ import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager; import com.mogo.eagle.core.function.v2x.events.consts.V2XConst; import com.mogo.eagle.core.function.v2x.events.scenario.IV2XScenarioManager; import com.mogo.eagle.core.function.v2x.events.scenario.scene.road.V2XRoadEventScenario; -import com.mogo.eagle.core.function.v2x.events.scenario.scene.route.V2XOptimalRouteVREventScenario; import com.mogo.eagle.core.function.v2x.events.scenario.scene.warning.V2XFrontWarningScenario; import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger; import com.mogo.eagle.core.utilcode.util.ThreadUtils; @@ -21,7 +20,6 @@ import com.mogo.eagle.core.utilcode.util.Utils; import com.mogo.map.uicontroller.IMogoMapUIController; import com.mogo.map.uicontroller.VisualAngleMode; -import java.util.concurrent.atomic.AtomicReference; /** * author : donghongyu @@ -68,10 +66,6 @@ public class V2XScenarioManager implements IV2XScenarioManager { case V2XMessageEntity.V2XTypeEnum.ALERT_ROAD_WARNING: mV2XScenario = new V2XRoadEventScenario(); break; - case V2XMessageEntity.V2XTypeEnum.ALERT_PUSH_VR_SHOW: - sceneChange(); - mV2XScenario = new V2XOptimalRouteVREventScenario(); - break; case V2XMessageEntity.V2XTypeEnum.ALERT_THE_FRONT_WEAKNESS: if (HmiBuildConfig.isShowCloudWeaknessTrafficView) { //默认关闭云端弱势交通 sceneChange(); diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/scene/airoad/AiRoadMarker.kt b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/scene/airoad/AiRoadMarker.kt index ef0cb94abc..e1eb7d8be3 100644 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/scene/airoad/AiRoadMarker.kt +++ b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/scene/airoad/AiRoadMarker.kt @@ -18,14 +18,11 @@ import com.mogo.eagle.core.utilcode.util.DrivingDirectionUtils import com.mogo.map.MogoMap import com.mogo.map.overlay.IMogoPolyline import com.mogo.map.overlay.MogoPolylineOptions -import mogo.telematics.pad.MessagePad import java.util.* -import java.util.concurrent.Executors -import java.util.concurrent.LinkedBlockingQueue import java.util.concurrent.atomic.AtomicReference import java.util.concurrent.ConcurrentHashMap -import com.mogo.eagle.core.function.v2x.events.marker.MarkerManager -import com.mogo.eagle.core.function.v2x.events.marker.MarkerWrapper +import com.mogo.eagle.core.function.v2x.events.remove.MarkerRemoveManager +import com.mogo.eagle.core.function.v2x.events.remove.MarkerWrapper /** * Ai云道路施工事件,道路颜色标记类 @@ -156,7 +153,7 @@ class AiRoadMarker { wrapper.addLine(line) } } - MarkerManager.addMarker(wrapper) + MarkerRemoveManager.addMarker(wrapper) } private fun removeLine() { diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/scene/road/V2XAiRoadEventMarker.kt b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/scene/road/V2XAiRoadEventMarker.kt index 563aada462..1ad84664da 100644 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/scene/road/V2XAiRoadEventMarker.kt +++ b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/scene/road/V2XAiRoadEventMarker.kt @@ -6,7 +6,7 @@ import com.mogo.eagle.core.data.map.* import com.mogo.eagle.core.data.map.entity.V2XRoadEventEntity import com.mogo.eagle.core.function.v2x.events.bridge.BridgeApi.context import com.mogo.eagle.core.function.v2x.events.bridge.BridgeApi.v2xMarker -import com.mogo.eagle.core.function.v2x.events.marker.MarkerWrapper +import com.mogo.eagle.core.function.v2x.events.remove.MarkerWrapper import com.mogo.map.* import com.mogo.map.marker.* import com.mogo.map.overlay.* diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/scene/road/V2XRoadEventMarker.java b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/scene/road/V2XRoadEventMarker.java index 4de55a0c84..a743246918 100644 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/scene/road/V2XRoadEventMarker.java +++ b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/scene/road/V2XRoadEventMarker.java @@ -10,8 +10,8 @@ import com.mogo.eagle.core.data.map.entity.MarkerLocation; import com.mogo.eagle.core.data.map.entity.V2XRoadEventEntity; import com.mogo.eagle.core.function.v2x.events.bridge.BridgeApi; import com.mogo.eagle.core.function.v2x.events.manager.IMoGoV2XMarkerManager; -import com.mogo.eagle.core.function.v2x.events.marker.MarkerWrapper; -import com.mogo.eagle.core.function.v2x.events.marker.MarkerManager; +import com.mogo.eagle.core.function.v2x.events.remove.MarkerWrapper; +import com.mogo.eagle.core.function.v2x.events.remove.MarkerRemoveManager; import com.mogo.eagle.core.function.v2x.events.scenario.scene.airoad.AiRoadMarker; import com.mogo.eagle.core.function.v2x.events.scenario.view.IV2XMarker; import com.mogo.map.marker.IMogoMarker; @@ -44,7 +44,7 @@ public class V2XRoadEventMarker implements IV2XMarker { ArrayList markers = new ArrayList<>(); markers.add(iMarker); String id = entity.getLocation().getLon() + "_" + entity.getLocation().getLat(); - MarkerManager.INSTANCE.addMarker(new MarkerWrapper(id, entity.getLocation().getLon(), entity.getLocation().getLat(), 0, markers, null)); + MarkerRemoveManager.INSTANCE.addMarker(new MarkerWrapper(id, entity.getLocation().getLon(), entity.getLocation().getLat(), 0, markers, null)); } else { Log.d("RWJ", "V2XRoadEventMarker:" + entity.getPoiType() + "--- return empty marker"); } @@ -101,20 +101,4 @@ public class V2XRoadEventMarker implements IV2XMarker { private boolean isDrawRoadLine(String poiType) { return EventTypeEnumNew.TYPE_SOCKET_ROAD_SHIGONG.getPoiType().equals(poiType); } - - @Override - public void clearPOI() { - // 移除线 -// IMoGoV2XPolylineManager polyLineManager = BridgeApi.INSTANCE.v2xPolyline(); -// if (polyLineManager != null) { -// polyLineManager.clearLine(); -// } -// IMoGoV2XMarkerManager v2xMarker = BridgeApi.INSTANCE.v2xMarker(); -// if (v2xMarker != null) { -// // 移除事件POI -// v2xMarker.clearAlarmPOI(); -// // 绘制上次的数据 -// v2xMarker.drawableLastAllPOI(); -// } - } } diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/scene/road/V2XRoadEventScenario.java b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/scene/road/V2XRoadEventScenario.java index 98998db728..7585e7f6c8 100644 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/scene/road/V2XRoadEventScenario.java +++ b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/scene/road/V2XRoadEventScenario.java @@ -1,14 +1,7 @@ package com.mogo.eagle.core.function.v2x.events.scenario.scene.road; - - -import android.util.Log; - -import com.mogo.cloud.commons.utils.CoordinateUtils; -import com.mogo.commons.analytics.AnalyticsUtils; import com.mogo.eagle.core.data.enums.EventTypeEnumNew; import com.mogo.eagle.core.data.enums.WarningDirectionEnum; -import com.mogo.eagle.core.data.map.MogoLocation; import com.mogo.eagle.core.data.map.entity.MarkerExploreWay; import com.mogo.eagle.core.data.map.entity.MarkerLocation; import com.mogo.eagle.core.data.map.entity.V2XMessageEntity; @@ -17,23 +10,16 @@ import com.mogo.eagle.core.data.msgbox.MsgBoxBean; import com.mogo.eagle.core.data.msgbox.MsgBoxType; import com.mogo.eagle.core.data.msgbox.V2XMsg; import com.mogo.eagle.core.function.api.hmi.warning.IMoGoWarningStatusListener; -import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ20ListenerManager; import com.mogo.eagle.core.function.call.hmi.CallerHmiManager; -import com.mogo.eagle.core.function.call.map.CallerMapLocationListenerManager; import com.mogo.eagle.core.function.call.map.CallerVisualAngleManager; import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxManager; -import com.mogo.eagle.core.function.v2x.events.consts.V2XConst; -import com.mogo.eagle.core.function.v2x.events.manager.V2XStatusManager; import com.mogo.eagle.core.function.v2x.events.scenario.impl.AbsV2XScenario; import com.mogo.eagle.core.function.v2x.events.scenario.view.IV2XMarker; import com.mogo.eagle.core.network.utils.GsonUtil; -import java.util.HashMap; -import java.util.Map; +import com.mogo.eagle.core.utilcode.mogo.logger.Logger; import java.util.Objects; import java.util.concurrent.TimeUnit; -import mogo.telematics.pad.MessagePad; - /** * author : donghongyu @@ -52,7 +38,7 @@ public class V2XRoadEventScenario extends AbsV2XScenario imp @Override public void init(V2XMessageEntity v2XMessageEntity) { try { - Log.d(TAG, "v2XMessageEntity:" + GsonUtil.jsonFromObject(v2XMessageEntity)); + Logger.d(TAG, "v2XMessageEntity:" + GsonUtil.jsonFromObject(v2XMessageEntity)); V2XRoadEventEntity v2XRoadEventEntity = v2XMessageEntity.getContent(); if (v2XRoadEventEntity != null) { if (v2XMessageEntity.isShowState()) { @@ -91,18 +77,6 @@ public class V2XRoadEventScenario extends AbsV2XScenario imp } } showWindow(); - String poiType = entity.getContent().getPoiType(); - String lat = String.valueOf(entity.getContent().getLocation().getLat()); - String lon = String.valueOf(entity.getContent().getLocation().getLon()); - String infoId = entity.getContent().getNoveltyInfo().getInfoId(); - String style = "1"; - Map properties = new HashMap<>(); - properties.put("dbid", infoId); - properties.put("type", poiType); - properties.put("lng", lon); - properties.put("lat", lat); - properties.put("style", style); - AnalyticsUtils.track(V2XConst.V2X_ROAD_SHOW, properties); } } catch (Exception e) { e.printStackTrace(); @@ -118,7 +92,7 @@ public class V2XRoadEventScenario extends AbsV2XScenario imp String ttsText = content.getTts(); if (alarmText == null || alarmText.isEmpty() || ttsText == null || ttsText.isEmpty()) { - Log.d("MsgBox-V2XRoadScenario", "alertContent或ttsContent为空!"); + Logger.d("MsgBox-V2XRoadScenario", "alertContent或ttsContent为空!"); } String poiType = content.getPoiType(); if (EventTypeEnumNew.TYPE_SOCKET_ROAD_SHIGONG.getPoiType().equals(poiType) || @@ -155,7 +129,6 @@ public class V2XRoadEventScenario extends AbsV2XScenario imp IV2XMarker marker = getV2XMarker(); if (marker != null) { // 重置告警信息 - V2XStatusManager.getInstance().setAlarmInfo(getV2XMessageEntity().getContent()); marker.drawPOI(getV2XMessageEntity().getContent()); } } diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/scene/route/V2XOptimalRouteVREventMarker.java b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/scene/route/V2XOptimalRouteVREventMarker.java deleted file mode 100644 index e2e6c77c1f..0000000000 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/scene/route/V2XOptimalRouteVREventMarker.java +++ /dev/null @@ -1,54 +0,0 @@ -package com.mogo.eagle.core.function.v2x.events.scenario.scene.route; - -import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_V2X; - -import com.mogo.eagle.core.function.v2x.events.bridge.BridgeApi; -import com.mogo.eagle.core.data.v2x.V2XOptimalRouteDataRes; -import com.mogo.eagle.core.function.v2x.events.manager.IMoGoV2XMarkerManager; -import com.mogo.eagle.core.function.v2x.events.observer.V2XOptimalRouteObserver; -import com.mogo.eagle.core.function.v2x.events.scenario.view.IV2XMarker; -import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger; - -/** - * author : donghongyu - * e-mail : 1358506549@qq.com - * date : 2020/5/15 5:37 PM - * desc : 推送VR场景 - * version: 1.0 - */ -public class V2XOptimalRouteVREventMarker implements IV2XMarker { - private final String TAG = "V2XPushVREventMarker"; - - @Override - public void drawPOI(V2XOptimalRouteDataRes entity) { - CallerLogger.INSTANCE.d(M_V2X + TAG, "drawPOI 绘制VR Marker"); - - try { - // 清除道路事件 - IMoGoV2XMarkerManager v2xMarker = BridgeApi.INSTANCE.v2xMarker(); - if (v2xMarker != null) { - v2xMarker.clearAlarmPOI(); - } - // 绘制引导线 - V2XOptimalRouteObserver.getInstance() - .setPolylinePoint(entity.getGd_locus_list()); - } catch (Exception e) { - e.printStackTrace(); - } - } - - @Override - public void clearPOI() { -// // 移除线 -// clearLine(); -// // 绘制上次的数据 -// IMoGoV2XMarkerManager v2xMarker = BridgeApi.INSTANCE.v2xMarker(); -// if (v2xMarker != null) { -// v2xMarker.drawableLastAllPOI(); -// } - } - - public void clearLine() { - V2XOptimalRouteObserver.getInstance().setPolylinePoint(null); - } -} diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/scene/route/V2XOptimalRouteVREventScenario.java b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/scene/route/V2XOptimalRouteVREventScenario.java deleted file mode 100644 index 2e38a64747..0000000000 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/scene/route/V2XOptimalRouteVREventScenario.java +++ /dev/null @@ -1,106 +0,0 @@ -package com.mogo.eagle.core.function.v2x.events.scenario.scene.route; - -import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_V2X; - -import androidx.annotation.Nullable; - -import com.mogo.eagle.core.data.map.entity.V2XMessageEntity; -import com.mogo.eagle.core.data.msgbox.MsgBoxBean; -import com.mogo.eagle.core.data.msgbox.MsgBoxType; -import com.mogo.eagle.core.data.msgbox.V2XMsg; -import com.mogo.eagle.core.function.api.hmi.warning.IMoGoWarningStatusListener; -import com.mogo.eagle.core.function.call.hmi.CallerHmiManager; -import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxManager; -import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger; -import com.mogo.eagle.core.function.v2x.events.bridge.BridgeApi; -import com.mogo.eagle.core.data.v2x.V2XOptimalRouteDataRes; -import com.mogo.eagle.core.function.v2x.events.manager.IMoGoV2XStatusManager; -import com.mogo.eagle.core.function.v2x.events.scenario.impl.AbsV2XScenario; -import com.mogo.eagle.core.function.v2x.events.scenario.view.IV2XMarker; -import com.mogo.eagle.core.network.utils.GsonUtil; - -import java.util.concurrent.TimeUnit; - -/** - * author : donghongyu - * e-mail : 1358506549@qq.com - * date : 2020/5/15 5:37 PM - * desc : 最优车道选择 - * version: 1.0 - * wiki : http://wiki.zhidaohulian.com/pages/viewpage.action?pageId=52829799 - */ -public class V2XOptimalRouteVREventScenario - extends AbsV2XScenario - implements IMoGoWarningStatusListener { - private String TAG = "V2XPushVREventWindow"; - - public V2XOptimalRouteVREventScenario() { - setV2XMarker(new V2XOptimalRouteVREventMarker()); - } - - @Override - public void init(@Nullable V2XMessageEntity v2XMessageEntity) { - CallerLogger.INSTANCE.w(M_V2X + TAG, "处理推送VR:" + GsonUtil.jsonFromObject(v2XMessageEntity)); - if (!isSameScenario(v2XMessageEntity)) { - setV2XMessageEntity(v2XMessageEntity); - show(); - } else { - setV2XMessageEntity(v2XMessageEntity); - show(); - CallerLogger.INSTANCE.w(M_V2X + TAG, "要处理的场景已经存在,丢弃这次初始化"); - } - } - - @Override - public void show() { - V2XMessageEntity entity = getV2XMessageEntity(); - if (entity != null) { - V2XOptimalRouteDataRes content = entity.getContent(); - if (content != null) { - CallerMsgBoxManager.INSTANCE.saveMsgBox( - new MsgBoxBean( - MsgBoxType.V2X, - new V2XMsg(entity.getType() + "", - "为您推荐最优路线", - "已为您选择最优路线") - ) - ); - CallerHmiManager.INSTANCE.warningV2X(entity.getType() + "", - "为您推荐最优路线", "已为您选择最优路线", TAG, - this, !entity.isOnlyShow(), TimeUnit.SECONDS.toMillis(30)); - } - } - } - - @Override - public void drawPOI() { - IV2XMarker marker = getV2XMarker(); - if (marker != null) { - marker.drawPOI(getV2XMessageEntity().getContent()); - IMoGoV2XStatusManager v2xStatus = BridgeApi.INSTANCE.v2xStatus(); - if (v2xStatus != null) { - v2xStatus.setPushPOIShow(TAG, true); - } - } - } - - @Override - public void clearPOI() { -// if (getV2XMarker() != null) { -// getV2XMarker().clearPOI(); -// } -// IMoGoV2XStatusManager v2xStatus = BridgeApi.INSTANCE.v2xStatus(); -// if (v2xStatus != null) { -// v2xStatus.setPushPOIShow(TAG, false); -// } - } - - @Override - public void onShow() { - drawPOI(); - } - - @Override - public void onDismiss() { - } -} diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/scene/warning/V2XFrontWarningScenario.java b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/scene/warning/V2XFrontWarningScenario.java index 85dc9db343..549e56d19f 100644 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/scene/warning/V2XFrontWarningScenario.java +++ b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/scene/warning/V2XFrontWarningScenario.java @@ -7,9 +7,7 @@ import android.text.Spannable; import android.text.SpannableStringBuilder; import android.text.style.ForegroundColorSpan; import android.util.Log; - import androidx.annotation.Nullable; - import com.mogo.eagle.core.data.enums.WarningDirectionEnum; import com.mogo.eagle.core.data.map.entity.V2XMessageEntity; import com.mogo.eagle.core.data.msgbox.MsgBoxBean; diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/scene/warning/V2XWarningMarker.java b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/scene/warning/V2XWarningMarker.java index fe3932017b..5bd251ea4e 100644 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/scene/warning/V2XWarningMarker.java +++ b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/scene/warning/V2XWarningMarker.java @@ -2,9 +2,7 @@ package com.mogo.eagle.core.function.v2x.events.scenario.scene.warning; import static com.mogo.eagle.core.data.constants.DataTypes.TYPE_MARKER_CLOUD_STOP_LINE_DATA; import static com.mogo.eagle.core.data.constants.DataTypes.TYPE_MARKER_CLOUD_WARN_DATA; -import static com.mogo.eagle.core.function.v2x.events.consts.V2XConst.V2X_FRONT_WARNING_MARKER; import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_V2X; - import com.mogo.cloud.commons.utils.CoordinateUtils; import com.mogo.commons.AbsMogoApplication; import com.mogo.commons.module.status.MogoStatusManager; @@ -26,12 +24,10 @@ import com.mogo.map.overlay.IMogoPolyline; import com.mogo.commons.utils.Trigonometric; import com.mogo.eagle.core.function.v2x.internal.data.V2XLocation; import com.mogo.eagle.core.function.v2x.internal.data.V2XWarningTarget; - import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.Objects; - import mogo.telematics.pad.MessagePad; /** @@ -446,19 +442,4 @@ public class V2XWarningMarker implements IV2XMarker { } CallerLogger.INSTANCE.d(M_V2X + TAG, "车辆行驶轨迹" + latLng.getLongitude() + "," + latLng.getLatitude()); } - - @Override - public void clearPOI() { - IMogoMarkerManager marker = CallerMapUIServiceManager.INSTANCE.getMarkerManager(AbsMogoApplication.getApp()); - if (marker != null) { - marker.removeMarkers(V2X_FRONT_WARNING_MARKER); - } - } - - public void clearLine() { - IMoGoWarnPolylineManager warnPolylineManager = BridgeApi.INSTANCE.v2xWarnPolyline(); - if (warnPolylineManager != null) { - warnPolylineManager.clearLine(); - } - } } diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/view/IV2XMarker.java b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/view/IV2XMarker.java index 5540ad2f79..8dcf008880 100644 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/view/IV2XMarker.java +++ b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/view/IV2XMarker.java @@ -10,7 +10,4 @@ package com.mogo.eagle.core.function.v2x.events.scenario.view; public interface IV2XMarker { void drawPOI(T entity); - - void clearPOI(); - } diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/utils/TestOnLineCarUtils.java b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/test/TestOnLineCarUtils.java similarity index 99% rename from core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/utils/TestOnLineCarUtils.java rename to core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/test/TestOnLineCarUtils.java index 62c8a64efa..0070ffbed8 100644 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/utils/TestOnLineCarUtils.java +++ b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/test/TestOnLineCarUtils.java @@ -1,4 +1,4 @@ -package com.mogo.eagle.core.function.v2x.events.utils; +package com.mogo.eagle.core.function.v2x.events.test; import static com.mogo.eagle.core.data.map.entity.V2XMessageEntity.V2XTypeEnum.ALERT_ROAD_WARNING; diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/receiver/TestPanelBroadcastReceiver.java b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/test/TestV2XReceiver.java similarity index 87% rename from core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/receiver/TestPanelBroadcastReceiver.java rename to core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/test/TestV2XReceiver.java index 59d5471e0f..70c5eae7c3 100644 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/receiver/TestPanelBroadcastReceiver.java +++ b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/test/TestV2XReceiver.java @@ -1,4 +1,4 @@ -package com.mogo.eagle.core.function.v2x.events.receiver; +package com.mogo.eagle.core.function.v2x.events.test; import android.content.BroadcastReceiver; import android.content.Context; @@ -12,7 +12,6 @@ import com.mogo.eagle.core.data.map.entity.V2XRoadEventEntity; import com.mogo.eagle.core.data.v2x.V2XOptimalRouteDataRes; import com.mogo.eagle.core.function.call.map.CallerSmpManager; import com.mogo.eagle.core.function.v2x.events.consts.V2XConst; -import com.mogo.eagle.core.function.v2x.events.utils.TestOnLineCarUtils; import java.util.List; @@ -21,8 +20,8 @@ import java.util.List; * * @author donghongyu */ -public class TestPanelBroadcastReceiver extends BroadcastReceiver { - private static final String TAG = V2XConst.MODULE_NAME + "_TestPanelBroadcastReceiver"; +public class TestV2XReceiver extends BroadcastReceiver { + private static final String TAG = "TestV2XReceiver"; private Context mContext; @@ -74,11 +73,7 @@ public class TestPanelBroadcastReceiver extends BroadcastReceiver { Intent intent = new Intent(V2XConst.BROADCAST_SCENE_HANDLER_ACTION); intent.putExtra(V2XConst.BROADCAST_SCENE_EXTRA_KEY, messageEntity); LocalBroadcastManager.getInstance(mContext).sendBroadcast(intent); - } /*else if (sceneType == 16) {//触发基于目的地预测的线路推荐 - V2XRefreshModel model = BridgeApi.INSTANCE.refreshModel(); - model. - V2XServiceManager.getV2XRefreshModel().queryRoadData("F803EB2046PZD00149"); - } */ else if (sceneType == 17) {//最优路线推荐 + } else if (sceneType == 17) {//最优路线推荐 V2XMessageEntity v2XMessageEntity = TestOnLineCarUtils.getV2XOptimalRoute(); diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/utils/TrackUtils.java b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/utils/TrackUtils.java index 87bf002efa..7d7f1a2244 100644 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/utils/TrackUtils.java +++ b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/utils/TrackUtils.java @@ -2,7 +2,6 @@ package com.mogo.eagle.core.function.v2x.events.utils; import com.mogo.commons.analytics.AnalyticsUtils; import com.mogo.eagle.core.function.v2x.events.consts.V2XConst; -import com.mogo.eagle.core.function.v2x.events.manager.V2XStatusManager; import java.util.HashMap; import java.util.Map; From d3f0ac654b8b618dbe979aeba2dcfa284eda077d Mon Sep 17 00:00:00 2001 From: zhongchao Date: Tue, 31 Jan 2023 15:26:32 +0800 Subject: [PATCH 13/18] [2.13.0-arch-opt] fix bug of limit speed and move view --- .../main/res/layout/bus_p_base_fragment.xml | 19 ---- .../och/bus/passenger/ExampleUnitTest.java | 34 +++---- .../src/main/res/layout/bus_base_fragment.xml | 25 ++++- .../java/com/mogo/och/noop/OchNoopFragment.kt | 39 +++----- .../main/res/layout/och_noop_fragment_hmi.xml | 95 ++++++------------- .../sweeper/view/SweeperTrafficDataView.java | 14 --- .../passenger/model/TaxiPassengerModel.java | 3 +- .../main/res/layout/taxi_p_base_fragment.xml | 19 ---- .../main/res/layout/taxi_base_fragment.xml | 16 ++++ .../hmi/ui/msgbox/DriverMsgBoxListView.kt | 2 +- .../msgbox/adapter/DriverMsgBoxListAdapter.kt | 24 +++-- .../hmi/ui/switch/DemoModeHiddenSwitch.kt | 18 ++-- .../hmi/ui/widget/LimitingVelocityView.kt | 16 ++-- .../function/hmi/ui/widget/VersionNameView.kt | 2 +- .../src/main/res/layout/fragment_hmi.xml | 40 +------- .../res/layout/view_limiting_speed_vr.xml | 10 +- 16 files changed, 136 insertions(+), 240 deletions(-) diff --git a/OCH/mogo-och-bus-passenger/src/main/res/layout/bus_p_base_fragment.xml b/OCH/mogo-och-bus-passenger/src/main/res/layout/bus_p_base_fragment.xml index 564aa1e394..95eaa395d2 100644 --- a/OCH/mogo-och-bus-passenger/src/main/res/layout/bus_p_base_fragment.xml +++ b/OCH/mogo-och-bus-passenger/src/main/res/layout/bus_p_base_fragment.xml @@ -26,16 +26,6 @@ app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintTop_toTopOf="parent"/> - - - - - - Testing documentation - */ -public class ExampleUnitTest { - @Test - public void addition_isCorrect() { - assertEquals(4, 2 + 2); - } -} \ No newline at end of file +//package com.mogo.och.bus.passenger; +// +//import org.junit.Test; +// +//import static org.junit.Assert.*; +// +///** +// * Example local unit test, which will execute on the development machine (host). +// * +// * @see Testing documentation +// */ +//public class ExampleUnitTest { +// @Test +// public void addition_isCorrect() { +// assertEquals(4, 2 + 2); +// } +//} \ No newline at end of file diff --git a/OCH/mogo-och-bus/src/main/res/layout/bus_base_fragment.xml b/OCH/mogo-och-bus/src/main/res/layout/bus_base_fragment.xml index da6d779a3b..fae3e46139 100644 --- a/OCH/mogo-och-bus/src/main/res/layout/bus_base_fragment.xml +++ b/OCH/mogo-och-bus/src/main/res/layout/bus_base_fragment.xml @@ -56,11 +56,27 @@ android:layout_width="120dp" android:layout_height="120dp" android:layout_marginTop="45dp" - android:layout_marginEnd="40dp" app:layout_constraintRight_toLeftOf="@id/viewTrafficLightVr" app:layout_constraintTop_toTopOf="parent" + tools:ignore="SpeakableTextPresentCheck" tools:visibility="visible" /> + + + + app:layout_constraintStart_toStartOf="parent" + tools:ignore="SpeakableTextPresentCheck" /> +